Running a Service forever in background - Android

后端 未结 4 465
青春惊慌失措
青春惊慌失措 2021-01-15 11:50

I have created a Service in my android application which starts automatically on BOOT_COMPLETE through BroadcastReceiver. And That is

4条回答
  •  再見小時候
    2021-01-15 12:08

    According to documentation.

    Reasons your service is killed:

    The Android system stops a service only when memory is low and it must recover system resources for the activity that has user focus.

    So as long as the above condition isn't met, your service will run forever.

提交回复
热议问题