Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Navigation drawer icon arrow instead of three lines

I have created a new project in eclipse with the navigation drawer and instead of the three lines icon on the top left of the screen I have the back arrow icon. I have found nothing on stack over flow which seems to help. I have tried to change the setDisplayHomeAsUpEnabled and setHomeButtonEnabled but it does not help here is a part of the code (by the way its the default code from eclipse) any one have and idea? enter image description here

like image 452
WolfJee Avatar asked Jun 13 '15 13:06

WolfJee


2 Answers

I believe you can try setting custom activity back button to Hamburger button.

Here is the code.

So you can change it programmatically easily by using homeAsUpIndicator() function that added in android API level 18 and upper.

ActionBar().setHomeAsUpIndicator(R.drawable.ic_yourindicator);

If you use support library

getSupportActionBar().setHomeAsUpIndicator(R.drawable.ic_yourindicator);
like image 167
Hiteshdua1 Avatar answered Nov 15 '22 17:11

Hiteshdua1


You can change your styles.xml file to replace the navigation drawer icon adding this code:

<item name="homeAsUpIndicator">@drawable/ic_drawer</item>
<item name="android:homeAsUpIndicator">@drawable/ic_drawer</item>

The ic_drawer icon (which you'll put in drawable folder) can be downloaded on the web.

like image 36
Filipe Brito Avatar answered Nov 15 '22 17:11

Filipe Brito