Created
July 15, 2019 17:12
-
-
Save alidaoud/1614df2bd494caad6ae078dc8ea895b4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //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