Android is killing my foreground service after Force stop my package

后端 未结 1 2089
心在旅途
心在旅途 2021-02-10 18:12

I\'ve been struggling with this for 2 weeks now.

I\'m developing an app that controls call duration.

I receive a braodcast where I start a foreground service to

1条回答
  •  迷失自我
    2021-02-10 18:35

    Edit:

    If you have the same issue please check Power Saving Options in your phone settings if your phone has this feature it will kill your app after the screen is off and will not allow it to work in background.

    Original answer: After a lot of search I solved it myself

    it turned out that my app was power-intensive as shown in the picture below

    Hence, android was force stopping it after 5 minutes when there is no activity on the screen to save power.

    I solved power consumption issues and everything became OK.

    0 讨论(0)
提交回复
热议问题