Save drawer toggle state

pull/50/head
M66B 6 years ago
parent 679b16dc5d
commit 7922434ff5

@ -204,6 +204,9 @@ public class ActivityView extends ActivityBase implements FragmentManager.OnBack
fragmentTransaction.commit(); fragmentTransaction.commit();
} }
if (savedInstanceState != null)
drawerToggle.setDrawerIndicatorEnabled(savedInstanceState.getBoolean("toggle"));
new SimpleTask<Long>() { new SimpleTask<Long>() {
@Override @Override
protected Long onLoad(Context context, Bundle args) throws Throwable { protected Long onLoad(Context context, Bundle args) throws Throwable {
@ -292,6 +295,12 @@ public class ActivityView extends ActivityBase implements FragmentManager.OnBack
checkIntent(getIntent()); checkIntent(getIntent());
} }
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.putBoolean("toggle", drawerToggle.isDrawerIndicatorEnabled());
}
@Override @Override
protected void onPostCreate(Bundle savedInstanceState) { protected void onPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState); super.onPostCreate(savedInstanceState);

Loading…
Cancel
Save