Skip to content

Instantly share code, notes, and snippets.

@aldakur
Last active June 13, 2016 11:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aldakur/3747223e9e85c7a709b80dda84cc971b to your computer and use it in GitHub Desktop.
Save aldakur/3747223e9e85c7a709b80dda84cc971b to your computer and use it in GitHub Desktop.
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