When I Clear All Recent Apps, Android System Kills My App Service On Android V7.1.2
enter image description hereI want to create an app which runs in the background. I have tried all stackoverflow solutions. Those solutions are all working when the app is cleared
Solution 1:
Some mobiles not allow to run app in background like oppo,xiaomi,huawei etc.. to solve this issue try this Link
Solution 2:
Thanks @code4rox. I'm using Xiaomi mobile, So it's required to enable auto start permission. Below code is working well.
if (Build.BRAND.equalsIgnoreCase("Xiaomi")) {
Intentintent1=newIntent();
intent1.setComponent(newComponentName("com.miui.securitycenter", "com.miui.permcenter.autostart.AutoStartManagementActivity"));
startActivity(intent1);
}
Post a Comment for "When I Clear All Recent Apps, Android System Kills My App Service On Android V7.1.2"