简体   繁体   中英

Android activity lifecycle when clicking on the HOME button

I have an application with only one activity running in the Android emulator:

  • When this activity has the focus and when I click on the HOME button, the onPause() and onStop() callbacks are invoked.
  • From there, if I run the "ps" command from an ADB shell, I can see one process corresponding to my application.
  • Now, if I start the application again, the onCreate(), onStart() and onResume() callbacks are invoked.

Since onCreate() is invoked, this seems to imply that the activity was either killed or shutdown. But in that case... why can I see it by running the "ps" command ?

There can be several activities of the same kind running.

Take a look at that:

http://developer.android.com/guide/topics/manifest/activity-element.html#lmode

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM