LimpLimp LimpLimp - 4 months ago 30
Android Question

ActionBar doesnt show title with spinner

My

ActionBar
title or Activity Tile doesnt show with
Spinner
drop down added. Any Ideas on what wrong?? I've done alot of research but I'm not seeing problems

public class MainActivity extends ListActivity implements ActionBar.OnNavigationListener{

private static final int EDITOR_ACT_REQUEST = 504;
private static final int MENU_DELETE_ID = 1002;
private ActionBar actionBar;
private ArrayList<SpinnerNavItem> navSpinner;
private TitleNavigationAdapter adapter;
String curdate;
private int currentNoteId;
private ArgueDataS datasource;
List<ArgueItem> argueList;
public static ArrayAdapter<String> add;
private ArgueItem note;
TextView day;
String datastring;


@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

actionBar = getActionBar();
actionBar.setDisplayShowTitleEnabled(true);
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);

// Spinner title navigation data
navSpinner = new ArrayList<SpinnerNavItem>();
navSpinner.add(new SpinnerNavItem("Argue Time", R.drawable.alarm));
navSpinner.add(new SpinnerNavItem("Top 10", R.drawable.topten));

adapter = new TitleNavigationAdapter(getApplicationContext(), navSpinner);

// assigning the spinner navigation
actionBar.setListNavigationCallbacks(adapter, this);

Answer

You should change

actionBar.setDisplayShowTitleEnabled(true);

to

actionBar.setDisplayShowTitleEnabled(false);