onStartCommand after service process is killed when started with START_STICKY

后端 未结 4 1730
天命终不由人
天命终不由人 2021-02-13 06:15

I have been reading the Android documentation and I am wondering if anyone can shed some light on what happens to a service instance when a service started with START_STICKY has

4条回答
  •  孤街浪徒
    2021-02-13 06:28

    When a process is killed and recreated, it goes through the entire lifecycle again (starting at onCreate). Depending on how it was killed and how you save data it may or may not be available to you.

    As for getting the intent back, there's a flag for START_REDELIVER_INTENT that will redeliver the intent.

提交回复
热议问题