Reputation: 41
I have some task to create one activity whith includes two Fragments.On first Fragment include the simple toolBar with title and one custom button in the end(ImageView), on second I need button back,search with functional, and title.What is the best way implement this??Create toolBar in activity and change it dependent on the status or create toolbar in each Fragment??if someone already has such realization in code I will be grateful for his browsing.
Thanks
Upvotes: 4
Views: 3038
Reputation: 23665
In your fragment(s), in onCreate()
call setHasOptionsMenu()
and implement the onCreateOptionsMenu()
method.
Also see the 'Adding items to the Actionbar' section of http://developer.android.com/guide/components/fragments.html
Upvotes: 1