I have a service in my app which needs to be running in the background all the time. On all devices, it\'s working fine except Xiaomi. I have read somewhere that we need to
You may try this:
if ("xiaomi".equalsIgnoreCase(str))
{
intent.setComponent(new ComponentName("com.miui.securitycenter", "com.miui.permcenter.autostart.AutoStartManagementActivity"));
}
else if ("oppo".equalsIgnoreCase(str))
{
intent.setComponent(new ComponentName("com.coloros.safecenter", "com.coloros.safecenter.permission.startup.StartupAppListActivity"));
}
else if ("vivo".equalsIgnoreCase(str))
{
intent.setComponent(new ComponentName("com.iqoo.secure", "com.iqoo.secure.MainGuideActivity."));
}