Eslam Yousef Mohammed
Eslam Yousef Mohammed

Reputation: 332

Changing Support ActionBarDrawerToggle icon

I'm using "android.support.v7.app.ActionBarDrawerToggle" and i need to use custom icon for the toggle, and i still get the default toggle icons although i initialized it as following :

mNavDrawerToggle = new ActionBarDrawerToggle(this
               ,mDrawerLayout
               ,R.drawable.menu // <-- My Custom Icon 
               , R.string.str_all) {
            }

// Update So Weird, It works with "android.support.v4.app.ActionBarDrawerToggle" which is deprecated and doesn't work with "android.support.v7.app.ActionBarDrawerToggle" which is not deprecated,

Any advice.?!, Thanks in advance,

Upvotes: 2

Views: 3805

Answers (2)

Shangeeth Sivan
Shangeeth Sivan

Reputation: 2320

Try this, mNavDrawerToggle.setHomeAsUpIndicator(R.drawable.ic_drawer);

Try Replacing the Home as Up Button with Your own image Hope this works

Upvotes: 1

Abhishek
Abhishek

Reputation: 1345

Try this

    mNavDrawerToggle = new ActionBarDrawerToggle(this
                   ,mDrawerLayout
                   , R.string.str_all, R.string.closeDrawerDescribtion) {
                }
mNavDrawerToggle.setHomeAsUpIndicator (R.drawable.your_icon);

Upvotes: 0

Related Questions