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?
Asked
Active
Viewed 1,433 times
1 Answers
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
-
I don't have any setup, I have a navigation drawer with more activity, but anyay u help me! – francesco.venica Feb 15 '15 at 21:10