Add my app to AutoStart apps list in android programmatically

前端 未结 3 496
Happy的楠姐
Happy的楠姐 2021-01-07 23:13

I want my app to be in the autostart list after installation.

I know when I install an app like (whatsapp) it goes automatically to the autostart list. I want my app

3条回答
  •  天涯浪人
    2021-01-07 23:31

    Some of the applications such as Whatsapp and Facebook might have been whiltlisted thats why they have automatic Autostart option enabled.

    But i have tried the following code for Xiaomi Devices hope this might help!!

        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);
        }
    

提交回复
热议问题