Running a Service forever in background - Android

后端 未结 4 467
青春惊慌失措
青春惊慌失措 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 11:57

    It is very simple.
    steps:
    1.create a Service class.
    2.create a BroadcastReceiver class
    3.call BroadReceiver in onDestroy method of service
    4.In onReceive method of BroadReceiver class start service once again.
    refer this link

提交回复
热议问题