1

I want to change the default home up button Icon of Action Bar in API Level 22

I am using AppCompatV7 for API Level 22 and I am extending ActionBar Activity.

Currently it looks like

default
and want to change it as

Required

What we have done:

In my default theme style I wrote following code

<item name="android:actionModeCloseDrawable">@drawable/up_button</item>

but it does not seems to work.

Dhaval Parmar
  • 18,812
  • 8
  • 82
  • 177
techierishi
  • 413
  • 3
  • 14

2 Answers2

4

I have done like this. it may help others.!!

mDrawerToggle.setDrawerIndicatorEnabled(false);//set false default

toolbar.setNavigationIcon(R.drawable.menu_icon);//add custom home buton

     toolbar.setNavigationOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
          mDrawerLayout.openDrawer(Gravity.START);
        }
    });
Kishore Jethava
  • 6,666
  • 5
  • 35
  • 51
0

I think that the attribute of the up button in the theme is called homeAsUpIndicator:

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

More info and posible solutions on this question

Hope it helps

Community
  • 1
  • 1
sabadow
  • 5,095
  • 3
  • 34
  • 51