MainakChoudhury
MainakChoudhury

Reputation: 524

Left Menu Icon on Action Bar in Android

How to Change the left side menu icon on the Action Bar ? I have created this using Navigation Drawer Fragment in Android Studio. Now an Arrow pointing left is displayed "<-" but i need to display the = icon. Where should i change this ?

Upvotes: 4

Views: 2142

Answers (2)

Gurupad Mamadapur
Gurupad Mamadapur

Reputation: 989

To toggle the indicator you've to use:

public void toogleDrawer(boolean value){
  mDrawerToggle.setDrawerIndicatorEnabled(!value);
  getSupportActionBar().setDisplayHomeAsUpEnabled(value);
}

Please post the complete code relating to your drawer fragment, and action bar setup(if any) and also the relevant layouts. You've to research around a bit before asking the question. Check this question here : Cannot listen clicks on up caret

Everyone can provide specific answers to your problem if you add more content to it.

Upvotes: 0

Malwinder Singh
Malwinder Singh

Reputation: 7060

You could use this format for your ActionBarDrawerToggle:

mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout,
    R.drawable.CUSTOM_ICON, // Navigation menu toggle icon
    R.string.DRAWER_OPEN, // Navigation drawer open description
    R.string.DRAWER_CLOSE // Navigation drawer close description
    )

Change your drawable and make sure it is the same name as the one in the code.

Upvotes: 1

Related Questions