[Solved] why use menu.findItem() and not findViewByID alone?


The difference is that the second line refers to menu to find its item and the first finds view in activity layout

Doc for the first line: https://developer.android.com/reference/android/app/Activity.html#findViewById(int)

Doc for the second line:
https://developer.android.com/reference/android/view/Menu.html#findItem(int)

solved why use menu.findItem() and not findViewByID alone?