0

I have a problem, I have different activity with different background color (white or blue), also the menu icon need to be white or blue (opposite to activity background), I can't find the correct way for change it after change activity, how can I do this?

francesco.venica
  • 1,703
  • 2
  • 19
  • 54

1 Answers1

1

U must do like this:

mDrawerToggle = new ActionBarDrawerToggle(
            this,                 
            mDrawerLayout,         
            R.drawable.ic_drawer, //<-- This is the icon provided by Google itself
            R.string.drawer_open,
            R.string.drawer_close 
            )

This in setUp() method.

And dont forget to add these code:

@Override
protected void onPostCreate(Bundle savedInstanceState) {
    super.onPostCreate(savedInstanceState);
    // Sync the toggle state after onRestoreInstanceState has occurred.
    mDrawerToggle.syncState();
}

@Override
public void onConfigurationChanged(Configuration newConfig) {
    super.onConfigurationChanged(newConfig);
    mDrawerToggle.onConfigurationChanged(newConfig);
}
GIGAMOLE
  • 1,274
  • 1
  • 11
  • 17