Search code examples
androidbuttonandroid-actionbar

How to create a Back Button in Material Design


I cannot find a tutorial about adding this button in the Action bar in Material Design.

example image

How can I add this into the action bar on Lollipop?


Solution

  • Material Design Tutorial This will give you brief idea how to implement material app.

    If you are using ActionBarActivity with AppCompat Theme use:

    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    

    Also you may have to call setHomeButtonEnabled(true) in same manner. It will look like this:

    enter image description here