如何在Android中以编程方式在小米手机安全应用程序中为我的应用程序启用自动启动选项 [英] How to enable AutoStart option for my App in Xiaomi phone Security App programmatically in android

查看:17
本文介绍了如何在Android中以编程方式在小米手机安全应用程序中为我的应用程序启用自动启动选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序在除 MI 之外的所有移动设备中都能获得好评.因为 MI 限制我的 App 后台服务运行.在安全中的自动启动中启用应用程序后,它运行良好.那么我可以通过编程方式在 MI 安全应用程序中为我的应用程序启用该自动启动选项吗?请告诉我您的宝贵建议.

My App is working with good remarks in all mobile except MI. Because MI restricting my App background service to run. After enabling App in Autostart in Security, it working perfectly. So can I enable that AutoStart Option for my app in MI Security App through programmatically. Please let me know your valuable suggestions.

我的疑问是 whatsapp、facebook 和许多其他应用程序如何默认启用小米安全应用程序中的自动启动选项?

And My doubt is how whatsapp , facebook and many more apps default enabling Autostart Option in Security App in Xiaomi?

提前致谢.

推荐答案

试试这个...它对我有用.它将打开屏幕以启用自动启动.

Try this...it's working for me. It will open the screen to enable autostart.

String manufacturer = "xiaomi";
        if(manufacturer.equalsIgnoreCase(android.os.Build.MANUFACTURER)) {
            //this will open auto start screen where user can enable permission for your app
            Intent intent = new Intent();
            intent.setComponent(new ComponentName("com.miui.securitycenter", "com.miui.permcenter.autostart.AutoStartManagementActivity"));
            startActivity(intent);
        }

这篇关于如何在Android中以编程方式在小米手机安全应用程序中为我的应用程序启用自动启动选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆