mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-20 23:56:20 +08:00
[CB-2908] Fix the DroidGap activity Lifecycle broken issue
Attempting to invoke the Activity's finish() onDestroy breaks an Activity's lifecycle flag. OnDestroy can be called by the system, for instance, on restarting an Activity, it's definitely different from a normal finish(). Finish() incorrectly in onDestroy results in another DroidGap derived activity is started, while the original one is not yet onDestroy. This issue could be found when the system is trying to restart the activity upon, for instance, receiving immediately successive device Config changes.
This commit is contained in:
parent
5ff900f7ec
commit
778b784eb6
@ -718,7 +718,7 @@ public class DroidGap extends Activity implements CordovaInterface {
|
||||
appView.handleDestroy();
|
||||
}
|
||||
else {
|
||||
this.endActivity();
|
||||
this.activityState = ACTIVITY_EXITING;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user