How to determine if the Android Application was force closed?

后端 未结 2 1227
星月不相逢
星月不相逢 2021-01-21 03:09

I need to determine, if my application was force closed, crashed, or terminated normally. My question is: How would you do such a thing in Android environment. Handling exceptio

2条回答
  •  一个人的身影
    2021-01-21 03:42

    Perhaps you could write a file on startup that you remove on shutdown. If the app starts and this file is present, you could conclude that it was force-closed.

提交回复
热议问题