Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ActionBar - Show & Hide
//When the class extends from Activity
ActionBar actionBar = getActionBar();
actionBar.hide(); //hide
actinBar.show(); //Show
//When the class extends from AppCompatActivity
getSupportActionBar().hide(); //hide
getSupportActionBar().show(); //show
//In FragmentActivity, you need to change the FragmentActivity to an ActionBarActivity,
//which is a subclass of FragmentActivity.
//Or change to AppCompatActivity
getSupportActionBar().hide(); //hide
getSupportActionBar().show(); //show
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment