Calling recreate() instead of finish() so that the activity

life cycle is handled properly

Change-Id: I6ee022ee3e81a0660f4798ab4b62ddcb163c7067
This commit is contained in:
Sunny Goyal
2017-05-22 15:59:15 -07:00
parent 09273b676e
commit e13d464539
+2 -3
View File
@@ -4140,9 +4140,8 @@ public class Launcher extends BaseActivity
public void onSharedPreferenceChanged(
SharedPreferences sharedPreferences, String key) {
if (Utilities.ALLOW_ROTATION_PREFERENCE_KEY.equals(key)) {
// Finish this instance of the activity. When the activity is recreated,
// it will initialize the rotation preference again.
finish();
// Recreate the activity so that it initializes the rotation preference again.
recreate();
}
}
}