Differentiate between Android killing the app and user swiping it off on the recent apps list

后端 未结 7 2108
死守一世寂寞
死守一世寂寞 2020-12-29 10:50

I am working on a project, where while being on a specific Activity we show a local sticky notification. That should also be the case when the app is minimized. What I have

相关标签:
7条回答
  • 2020-12-29 11:34

    In general, if Android wants to kill your application because it has been in the background for too long (or because it wants to reclaim resources), Android will just simply kill the OS process hosting your app. It will not call finish() or onDestroy() on any Activity or Service components. The behaviour of "swipe from recent tasks list" has changed over time and is different in different Android versions. Someone should write a book about that :-(

    0 讨论(0)
提交回复
热议问题