apache/cordova-android — pull request #42 by huangmenghuai (2013-04-01 09:10:06+00:00)
Title: Fix the DroidGap activity Lifecycle broken issue onDestroy.

This request is trying to fix the issue that the DroidGap derived Activities are restarted by the system in an incorrect order due to the finish() invocation onDestroy().

Please check attached log snapshots for the issue log.

--------------

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.

---------------

![error](https://f.cloud.github.com/assets/4023588/323304/504dbfdc-9aab-11e2-9ba3-7933ad111543.gif)

The corresponding device "Config Change" notification:
![error_configchanged](https://f.cloud.github.com/assets/4023588/323306/6526262e-9aab-11e2-8d63-38978337685d.gif)