stuart-d2
4/4/2014 - 2:08 PM

Action Bar

Action Bar

Notes on changing the menu at Runtime :  http://developer.android.com/guide/topics/ui/menus.html#ChangingTheMenu

--------------------
//Remove the icon from a actionbar
final ActionBar actionBar = getActionBar();     
actionBar.setDisplayShowTitleEnabled(false);
***

//Remove the App Name 
actionBar.setDisplayShowHomeEnabled(false);

***
//Set ActionBar text
private void setActiobarTitle(String title)
 {

    View v = getActionbar().getCustomView();
    TextView titleTxtView = (TextView) v.findViewById(R.id.actionbarTitle);
    titleTxtView.setText(title);
 }
 ***
 //Custom Action Bar calling 
 ActionBar actionBar = getActionBar(); 
  actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
  actionBar.setCustomView(R.layout.action_bar);