1

I had create a foreground application in Android 12 that is working fine when tha app is remove from recent task. when I had using my mobile cleaner the foreground service also killed.

How to prevent the foreground service killed by mobile cleaner

  • 3
    People use these kinds of ridiculous apps because they *want* to force all apps to close. Not much you can do about that except try to educate customers about why these apps make their phones perform worse, not better. – Tenfour04 Aug 04 '22 at 18:36
  • Yeah the best you can do is try to warn people if your app is something that could be affected by this stuff (it's usually a problem when the app's supposed to run in the background). It's not just cleaner/"green" apps, some manufacturers heavily restrict what apps can do on their devices, and you need to explicitly opt apps out of these restrictions. https://dontkillmyapp.com is a typical resource devs point users to, but that's not about cleaner apps. Maybe you can detect if your app was killed (didn't complete properly) and display a warning / info links next time they open it? – cactustictacs Aug 04 '22 at 18:53
  • The issue looks like a copy of https://stackoverflow.com/questions/34222943/how-to-restart-service-after-the-app-is-killed-from-recent-tasks – guest Aug 07 '22 at 13:18

0 Answers0