3
private void setTabNavigation(ActionBar bar){
    String[] actions = new String[] {
            "Bookmark",
            "Subscribe",
            "Share"
    };
    bar.removeAllTabs();
    bar.setDisplayHomeAsUpEnabled(true);
    bar.setBackgroundDrawable(new ColorDrawable(Color.parseColor("#a5a5a5")));
    bar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
    ArrayAdapter<String> adapter = new ArrayAdapter<String>(
       getBaseContext(),  
          android.R.layout.simple_spinner_dropdown_item, actions);
}

How can i add spinners to my title bar of action-bar? I get the small arrow besides my title-bar, but how would i add spinner to it and event-listener.

theJava
  • 14,620
  • 45
  • 131
  • 172
  • I believe that [this will help you](http://stackoverflow.com/questions/13756713/gmail-android-app-like-actionview-spinner-navigation-mode-list) – Lefteris Mar 23 '13 at 11:43

1 Answers1

5

You are missing setting the

bar.setListNavigationCallbacks(adapter, mNavigationCallback);

You have a good example in the developer.android.com http://developer.android.com/guide/topics/ui/actionbar.html

Filipe Batista
  • 1,862
  • 2
  • 24
  • 39