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

前端 未结 3 435
暖寄归人
暖寄归人 2021-01-21 00:28

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:

@Overrid         


        
3条回答
  •  鱼传尺愫
    2021-01-21 00:41

    You are doing it wrong. This is what the Doc says:

    Note: do not count on this method being called as a place for saving data! [...] There are situations where the system will simply kill the activity's hosting process without calling this method (or any others) in it, so it should not be used to do things that are intended to remain around after the process goes away.

    http://developer.android.com/reference/android/app/Activity.html#onDestroy%28%29

提交回复
热议问题