Reputation: 2159
How do I solve the following problem
1) FragmentActivity load with ActionBar and a homescreen fragment
2) When user selects "Item1" from ActionBar another Fragment is displayed.
3) User then presses back button to return to the homescreen Fragment
Problem:
The homescreen fragment is displayed but the ActionBar still points to "Item1".
What should I do to get ActionBar pointing back to homescreen after back button is pressed ?
Thanks
Upvotes: 0
Views: 546
Reputation: 1234
Manage your action bar in your home screen fragment rather than the activity. After you press back from Item1, somewhere in the lifecycle of the home screen fragment prior to the fragment being active, re-initialize your action bar.
Upvotes: 1