[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:
HUANG Menghuai 2013-04-01 12:40:51 +08:00 committed by Andrew Grieve
parent 5ff900f7ec
commit 778b784eb6

View File

@ -718,7 +718,7 @@ public class DroidGap extends Activity implements CordovaInterface {
appView.handleDestroy();
}
else {
this.endActivity();
this.activityState = ACTIVITY_EXITING;
}
}