android 跳转到小米手机神隐模式
16lz
2022-05-29
今天,讲讲如何跳转到小米手机的神隐模式。
传统做法:
public void openBigGodMode(View v){ Intent intent = new Intent(); intent.setComponent(new ComponentName("com.miui.powerkeeper", "com.miui.powerkeeper.ui.HiddenAppsContainerManagementActivity")); startActivityForResult(intent,GOD_MODE_ALL);}
这样,只是跳转到所以设置app神隐模式的设置界面。如果想跳转到具体app应用的设置界面,那怎么办?其实也很简单。
最好的做法:(用户体验最佳)
public void openGodMode(View v){ Intent intent = new Intent(); intent.setComponent(new ComponentName("com.miui.powerkeeper", "com.miui.powerkeeper.ui.HiddenAppsConfigActivity")); intent.putExtra("package_name", "app的包名(应用id)"); intent.putExtra("package_label", "app名称"); startActivity(intent);}
这样就直接跳转到app的设置神隐模式的界面。但是需要注意小米的android 版本应该大于6.0,不然可能不能跳转。
android 跳转到小米手机神隐模式就讲完了。
就这么简单。
更多相关文章
- Android(安卓)TextView设置一个或多个关键字的颜色
- android 启动延迟加载画面
- Android标题栏各种设置
- 隐藏Android底部的虚拟按键
- Android(安卓)解决阿里云直播水印问题
- Android调用Webview中的js方法
- Android(安卓)图片缩放实例详解
- Android(安卓)Retrofit 笔记之一使用拦截器设置缓存
- Android(安卓)Camera中参数设置