diff options
| author | 2018-08-23 19:28:57 -0700 | |
|---|---|---|
| committer | 2018-08-23 19:38:30 -0700 | |
| commit | 0de0eca77287db74884a21e0c972394de411a3dd (patch) | |
| tree | b452f16bb50474271aeebde0728ee889a725c58b | |
| parent | be3a75cb550f9a009cbcd40242923e2659a6ac70 (diff) | |
Deprecate Activity.onStateNotSaved
This callback is no longer accurate, because it is basically
onPreResume(), but onSaveInstance isn't related to Pause/Resume
at all. In addition, this callback was added for framework fragments
and they are deprecated
bug: 113134425
Test: no logic changes
Change-Id: I8f961846b52032d9760d5050a2d8ee5ec57c49cd
| -rw-r--r-- | api/current.txt | 2 | ||||
| -rw-r--r-- | core/java/android/app/Activity.java | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/api/current.txt b/api/current.txt index e9f57562fa3b..94703b856318 100644 --- a/api/current.txt +++ b/api/current.txt @@ -3765,7 +3765,7 @@ package android.app { method public boolean onSearchRequested(android.view.SearchEvent); method public boolean onSearchRequested(); method protected void onStart(); - method public void onStateNotSaved(); + method public deprecated void onStateNotSaved(); method protected void onStop(); method protected void onTitleChanged(java.lang.CharSequence, int); method public boolean onTouchEvent(android.view.MotionEvent); diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java index 8d5b96bdd051..6d7011ab2483 100644 --- a/core/java/android/app/Activity.java +++ b/core/java/android/app/Activity.java @@ -1349,7 +1349,12 @@ public class Activity extends ContextThemeWrapper * to give the activity a hint that its state is no longer saved -- it will generally * be called after {@link #onSaveInstanceState} and prior to the activity being * resumed/started again. + * + * @deprecated starting with {@link android.os.Build.VERSION_CODES#P} onSaveInstanceState is + * called after {@link #onStop}, so this hint isn't accurate anymore: you should consider your + * state not saved in between {@code onStart} and {@code onStop} callbacks inclusively. */ + @Deprecated public void onStateNotSaved() { } |