华为手机锁屏清理页面跳转
来源:互联网 发布:hipanda淘宝 编辑:程序博客网 时间:2024/04/28 06:57
try{ Intent intent = new Intent(); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); ComponentName componentName = new ComponentName("com.huawei.systemmanager", "com.huawei.systemmanager.optimize.process.ProtectActivity"); intent.setComponent(componentName); mContext.startActivity(intent);}catch (Exception e){ DialogUtils.makeText("打开锁屏清理页面失败!");}
安卓 查看手机 当前页面 程序报名 和页面activity 名称
cmd 命令
adb shell dumpsys activity top
=====================================================================
/** * Mobile Info Utils * create by heliquan at 2017年3月23日 */public class MobileInfoUtils { /** * Get Mobile Type * * @return */ private static String getMobileType() { return Build.MANUFACTURER; } /** * GoTo Open Self Setting Layout * Compatible Mainstream Models 兼容市面主流机型 * * @param context */ public static void jumpStartInterface(Context context) { Intent intent = new Intent(); try { intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); Log.e("HLQ_Struggle", "******************当前手机型号为:" + getMobileType()); ComponentName componentName = null; if (getMobileType().equals("Xiaomi")) { // 红米Note4测试通过 componentName = new ComponentName("com.miui.securitycenter", "com.miui.permcenter.autostart.AutoStartManagementActivity"); } else if (getMobileType().equals("Letv")) { // 乐视2测试通过 intent.setAction("com.letv.android.permissionautoboot"); } else if (getMobileType().equals("samsung")) { // 三星Note5测试通过 componentName = new ComponentName("com.samsung.android.sm_cn", "com.samsung.android.sm.ui.ram.AutoRunActivity"); } else if (getMobileType().equals("HUAWEI")) { // 华为测试通过 componentName = new ComponentName("com.huawei.systemmanager", "com.huawei.systemmanager.optimize.process.ProtectActivity"); } else if (getMobileType().equals("vivo")) { // VIVO测试通过 componentName = ComponentName.unflattenFromString("com.iqoo.secure/.safeguard.PurviewTabActivity"); } else if (getMobileType().equals("Meizu")) { //万恶的魅族 // 通过测试,发现魅族是真恶心,也是够了,之前版本还能查看到关于设置自启动这一界面,系统更新之后,完全找不到了,心里默默Fuck! // 针对魅族,我们只能通过魅族内置手机管家去设置自启动,所以我在这里直接跳转到魅族内置手机管家界面,具体结果请看图 componentName = ComponentName.unflattenFromString("com.meizu.safe/.permission.PermissionMainActivity"); } else if (getMobileType().equals("OPPO")) { // OPPO R8205测试通过 componentName = ComponentName.unflattenFromString("com.oppo.safe/.permission.startup.StartupAppListActivity"); } else if (getMobileType().equals("ulong")) { // 360手机 未测试 componentName = new ComponentName("com.yulong.android.coolsafe", ".ui.activity.autorun.AutoRunListActivity"); } else { // 以上只是市面上主流机型,由于公司你懂的,所以很不容易才凑齐以上设备 // 针对于其他设备,我们只能调整当前系统app查看详情界面 // 在此根据用户手机当前版本跳转系统设置界面 if (Build.VERSION.SDK_INT >= 9) { intent.setAction("android.settings.APPLICATION_DETAILS_SETTINGS"); intent.setData(Uri.fromParts("package", context.getPackageName(), null)); } else if (Build.VERSION.SDK_INT <= 8) { intent.setAction(Intent.ACTION_VIEW); intent.setClassName("com.android.settings", "com.android.settings.InstalledAppDetails"); intent.putExtra("com.android.settings.ApplicationPkgName", context.getPackageName()); } } intent.setComponent(componentName); context.startActivity(intent); } catch (Exception e) {//抛出异常就直接打开设置页面 intent = new Intent(Settings.ACTION_SETTINGS); context.startActivity(intent); } }}
阅读全文
1 0
- 华为手机锁屏清理页面跳转
- android开发 华为手机锁屏存活,开机自启动,一键不清理,手动杀死自动起来
- 根据Agent跳转到手机页面
- 手机浏览网页,则跳转页面
- 自动识别设备跳转手机页面代码
- JS跳转手机QQ的聊天页面
- Intent 跳转到手机拨打电话页面
- iOS 跳转到手机设置各种页面
- 判断pc跳转手机端页面
- 手机访问网站自动跳转到手机页面
- android开发 华为 点击跳转到权限管理页面
- android开发 华为 点击跳转到权限管理页面
- android开发 华为 点击跳转到权限管理页面
- PHP 判断访问来源是否来自手机并跳转页面
- ASP检测手机客户端并跳转到相应页面
- 手机页面跳转时传递中文参数出现乱码问题
- iOS 从APP 跳转到手机设置页面
- js判断是否为手机访问 跳转页面
- mongoDB安装并配置
- Nginx负载均衡的4种方案配置实例
- 吃货必备,2017年最好吃的零食都在这了
- 异常类
- MyEclipse中查找的快捷键
- 华为手机锁屏清理页面跳转
- 9 神经网络算法之梯度下降
- Xen使用Pass-through和SR-IOV
- KEIL MDK多字符串数组的使用
- mysql binlog日志简介及操作详解
- [BZOJ]1086 王室联邦 树分块
- 图片链接测试
- leetcode_698. Partition to K Equal Sum Subsets ? 待解决
- oracle数据库和mysql数据库列类型对照