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
This commit is contained in:
@@ -642,7 +642,7 @@ import java.util.function.Consumer;
|
||||
* protected void onCreate(Bundle savedInstanceState) {
|
||||
* super.onCreate(savedInstanceState);
|
||||
*
|
||||
* SharedPreferences mPrefs = getSharedPreferences();
|
||||
* mPrefs = getSharedPreferences(getLocalClassName(), MODE_PRIVATE);
|
||||
* mCurViewMode = mPrefs.getInt("view_mode", DAY_VIEW_MODE);
|
||||
* }
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user