How to keep my app service keep running even if app is closed from task manager in MI phone

后端 未结 3 817
-上瘾入骨i
-上瘾入骨i 2020-12-06 02:48

My app has background service which keep on running even if app is killed from the task manager but when I have tested my app on MI(xiaomi) phone it kills my app service whe

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-06 02:50

    you are not able to do that from code until and unless there is some api from xiaomi that gives you access to that functionality. I am guessing auto start manager is an app( with privileges of that of a system app, since part of xiaomi modified os) , hence not possible.

    But if the device is rooted you can actually disable autostart manager.

    Still whatsapp , facebook and many more apps doing this may be because of they have tie ups with Xiaomi to be in the whitelist. But its just a guess.

提交回复
热议问题