Android – How to Enable Autostart option programmatically in Xiaomi devices?

The autostart feature will get enabled automatically when you will download the app from playstore if xiaomi OS wants it as apps like amazon ,google IO etc are also not allowed to autostart ,In this case you have to go to Security permissions -> autostart -> then enable autostart from there.You cannot make the app autostart by code all you can do is you can show a dialog to enable auto start and take the user to the autostart activity but this is not a good option as you cannot check whether autostart is enabled or not.
This is done by Mi in MIUI8 for saving battery .This issue wasted my 2 days XD

You can refer to this article.

Leave a Comment