Skip to content
This repository has been archived by the owner on Nov 12, 2022. It is now read-only.

Commit

Permalink
Save drawer state in Activity's private SharedPreferences
Browse files Browse the repository at this point in the history
  • Loading branch information
schaal committed Jun 5, 2017
1 parent 5f0327f commit 4c4fbbb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/src/main/java/email/schaal/ocreader/ListActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ public boolean onLongClick(View v) {
if(savedInstanceState == null && getIntent().hasExtra(SyncService.EXTRA_ID)) {
drawerManager.getState().restore(getRealm(), getIntent().getIntExtra(SyncService.EXTRA_ID, -10), null, false);
} else {
drawerManager.getState().restoreInstanceState(getRealm(), PreferenceManager.getDefaultSharedPreferences(this));
drawerManager.getState().restoreInstanceState(getRealm(), getPreferences(MODE_PRIVATE));
}

binding.itemsRecyclerview.addItemDecoration(new DividerItemDecoration(this, R.dimen.divider_inset));
Expand Down Expand Up @@ -425,14 +425,14 @@ private boolean isShowOnlyUnread() {
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.putParcelable(LAYOUT_MANAGER_STATE, layoutManager.onSaveInstanceState());
drawerManager.getState().saveInstanceState(PreferenceManager.getDefaultSharedPreferences(this));
drawerManager.getState().saveInstanceState(getPreferences(MODE_PRIVATE));
adapter.onSaveInstanceState(outState);
}

@Override
public void onBackPressed() {
super.onBackPressed();
drawerManager.getState().saveInstanceState(PreferenceManager.getDefaultSharedPreferences(this));
drawerManager.getState().saveInstanceState(getPreferences(MODE_PRIVATE));
}

private void onStartDrawerItemClicked(TreeItem item) {
Expand Down

0 comments on commit 4c4fbbb

Please sign in to comment.