OnDestroy () will not be called after this.finish ()

I'm wondering why Motorola Milestone with 2.1-update1 behaves differently than an emulator or, for example, Nexus One. I am trying to exit my application with:

@Override
protected void onPause() {
    if(mayDestroyActivity) this.finish();
    super.onPause();
}

This works well with either the emulator or the Nexus One. onDestroy()called immediately after onPause()and onStop. But not for Milestone. Instead, onDestroy()called when another action is triggered. Its section in the manifest is as follows:

<activity android:name=".MyActivity"  
    android:configChanges="orientation|keyboardHidden"  
 android:label="@string/questionnaire_item"
 android:launchMode="singleInstance"
    android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
 android:windowSoftInputMode="adjustPan">
 <intent-filter>
  <category android:name="android.intent.category.OPENABLE" />
 </intent-filter>
</activity>

Does anyone have a hint of this? My application depends on the correct exit, since I save all changes toonDestroy()

Thanks
Stef

+3
source share
3 answers

, , . , . saveInstanceState onPause.

Android, , , .

+2

onSaveInstanceState, .

+2

Source: https://habr.com/ru/post/1749901/


All Articles