简体   繁体   中英

Intent launches Activity, but Activity disappears when pressing the home button

I have made an app. When I launch that app in the normal way, then it works fine. When I press the home button, the app is paused and is still there as it should be. Now I want to start my app by an intent...so eg when a NFC tag is detected the app should launch. This also works, but when I am pressing the home button then the app disappears, but I would like that it stays open (in pause mode) like when I launch it in the "normal wayy". Does anyone know why this can happen? My observation is that the onStop() function is called but not the onDestroy() function. Therefore it is very strange that the app just "disappears". Thanks a lot in advance.

Please see Android Activity Lifecycle . onDestroy() is not always called when application goes to background and generally here are no guarantee that onDestory() will be called before app/activity is killed.

Could you please explain what you mean 'pause mode'? You mean that app saves the state?

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