After performing the activities A, B, C, D, and E in order, move the int from E to B and do "FLAG_ACTIVITY_CLEAR_TOP" In that case, the remaining activities It should be A and B, but is it correct that the method running on B is changed from onStop() state to onStart() after onRestart() state?
Then, I wonder if onCreate() is running instead of onStart() of C activity when you run the next C activity!
android
If you call B from the stack of A > B > C > D > E using the properties of FLAG_ACTIVITY_CLEAR_TOP, it will be removed in the order of E, D, and C, and B will be restarted from onCreate().
As you said, if you want to run it in the order of onRestart() > onStart() > onResume(), you must also use the properties of FLAG_ACTIVITY_SINGLE_TOP as shown in the code below.
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
© 2024 OneMinuteCode. All rights reserved.