I am working from the ActionbarSherlock example for the Dropdown navigation. And I have something like this:
setTheme(R.style.Theme_Sherlock_Light);
Context context = getSupportActionBar().getThemedContext();
ArrayAdapter<CharSequence> list = ArrayAdapter.createFromResource(
context, R.array.locations, R.layout.sherlock_spinner_item);
list.setDropDownViewResource(R.layout.sherlock_spinner_dropdown_item);
getSupportActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
getSupportActionBar().setListNavigationCallbacks(list, this);
And that works to show the dropdown list in the nav area. But when I select an item from the dropdown, it does nothing. How do I determine what item was selected and go to that activity?
Thank you!
getSupportActionBar().setListNavigationCallbacks(list, this);
With the line above, you're supplying this
as the ActionBar.OnNavigationListener
that will receive the callbacks for when a navigation item is selected.
Since it sounds like you don't have any compile errors, your activity should have a method somewhere with the following footprint:
onNavigationItemSelected(int itemPosition, long itemId) { ... }
That's where you'll want to implement your logic for changing activities, fragments etc based on the selected navigation item.