onDestroy() won't get called after this.finish()

Posted by steff on Stack Overflow See other posts from Stack Overflow or by steff
Published on 2010-06-14T09:49:14Z Indexed on 2010/06/14 9:52 UTC
Read the original article Hit count: 239

Filed under:
|
|

Hi everyone,

I'm wondering why the Motorola Milestone with 2.1-update1 behaves differently from the Emulator or e.g. the Nexus One. I am trying to exit my app with:

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

This works well on either Emulator or Nexus One. onDestroy() gets called immediatly after onPause() and onStop. But not for the Milestone. Instead, onDestroy() gets called when another Activity is started. Its section in the Manifest looks like this:

<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 on this? My app depends on exiting properly since I save all progress in onDestroy()

Thanks,
Steff

© Stack Overflow or respective owner

Related posts about android

Related posts about difference