Skip to content

Instantly share code, notes, and snippets.

@alidaoud
Created July 15, 2019 17:12
Show Gist options
  • Select an option

  • Save alidaoud/1614df2bd494caad6ae078dc8ea895b4 to your computer and use it in GitHub Desktop.

Select an option

Save alidaoud/1614df2bd494caad6ae078dc8ea895b4 to your computer and use it in GitHub Desktop.
//If you are using an ActionBarActivity then you can tell Android to use the Toolbar as the ActionBar like so:
Toolbar toolbar = (Toolbar) findViewById(R.id.my_awesome_toolbar);
setSupportActionBar(toolbar);
//And now to make sure that the back arrow is gonna show
getSupportActionBar().setDisplayHomeAsUpEnabled(true); //or for fragments //((ActionBarActivity) getActivity()).getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowHomeEnabled(true); //or for fragments //((ActionBarActivity) getActivity()).getSupportActionBar().setDisplayShowHomeEnabled(true);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment