I have an application in which I’ve implemented tab navigation between fragments using Action Bar (specifically ActionBarSherlock). In one particular fragment I’m using to display a list of messages, I’d like to use something like spinner widget to select between an ‘Inbox’ and an ‘Outbox’. I need the selected option to appear persistent in order for the user to be able to tell what ‘box’ they’re looking at.
It’s simple enough to do this using options menu by using Fragment.setHasOptionsMenu,and I could perform the same action doing so. However I’m wondering if it’s possible for fragments to participate in populating the Action Bar with a navigation widget the same way we can with option menu items. I have checked the Fragment class but I couldn’t find anything that might help.
It sounds like what you want in the case of your Inbox/Outbox is
NAVIGATION_MODE_LIST, but you’re already usingNAVIGATION_MODE_TABSfor navigation. I have two suggested paths:NAVIGATION_MODE_LISTon that activity.As far as I know, you can’t use both tabs and lists on the actionbar. You’ll have to separate them out so you can use tabs in one case, lists in another, or create a custom solution.