When/why does my Java singleton instance get destroyed?

前端 未结 4 1859
刺人心
刺人心 2020-12-16 03:34

I have an android app that is setup to start a Java activity (call it MyJavaActivity), which in turn launches a NativeActivity. When the NativeActivity finishes it returns b

4条回答
  •  情歌与酒
    2020-12-16 04:35

    Each Android app runs in its own process so as long as it keeps running, your singleton will be available. When the process dies, your singleton is lost. Therefore when the app is re-launched this singleton object will need to be re-created.

提交回复
热议问题