Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 46eb2d09 authored by Jeff Chang's avatar Jeff Chang
Browse files

Update saving persistent state documentation

Updated the code snippet for saving persistent state to make the code
workable.
 - Update usage for getSharedPreferences.
 - Fix NPE when access mPrefs

Bug: 181924060
Test: Build
Change-Id: I695ad13282d5d9adb4a79108dfd1b6aae7b5a167
parent 238ab956
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -642,7 +642,7 @@ import java.util.function.Consumer;
 *     protected void onCreate(Bundle savedInstanceState) {
 *     protected void onCreate(Bundle savedInstanceState) {
 *         super.onCreate(savedInstanceState);
 *         super.onCreate(savedInstanceState);
 *
 *
 *         SharedPreferences mPrefs = getSharedPreferences();
 *         mPrefs = getSharedPreferences(getLocalClassName(), MODE_PRIVATE);
 *         mCurViewMode = mPrefs.getInt("view_mode", DAY_VIEW_MODE);
 *         mCurViewMode = mPrefs.getInt("view_mode", DAY_VIEW_MODE);
 *     }
 *     }
 *
 *