onCreate() called while Activity is stopped (but not destroyed). Only after installation

后端 未结 4 1180
醉话见心
醉话见心 2021-01-01 04:22

I\'m working on an app that targets Api 19, and that is basically a Processing sketch.

The problem I\'m facing is that the first time my app is run, right after inst

4条回答
  •  清酒与你
    2021-01-01 05:14

    This looks like a valid application lifecycle, you put your app to background, android is then allowed to destroy your app. onDestroy is not guaranteed to be called, you have to be prepared for that, as you say onPause is called so you can use it. Why it happens only once after install is hard to explain, but in my opinion you should not actually care about it and prepare your app to be killed any time it is in background.

提交回复
热议问题