I want to make a toolbar with a simple about button. I have tons of activities but I don't want to implement the same onOptionItemSelected and onCreateOptionsMenu as many times as many activities I have. Is there any way to give this toolbar some kind of abstraction?
Thank you!
For reusing the same toolbar across your activities, you can create a BaseActivity which handles inflation of your menu and then you can extend this BaseActivity for all other Activities.
Implement onCreateOptionsMenu
and onOptionItemSelected
in the BaseActivity. In that case, you don't need to implement these methods individually in all activities.