透過我的研究找到了,方法,透過intent,然後傳遞自己的應用ID,這樣就可以跳到自己的應用設定頁,否則就跳到隨機一個設定頁 程式碼其實很簡單,大家絕對能看懂,不說了 PackageManager pm = context.getPackageManager(); PackageInfo info = null; try { info = pm.getPackageInfo(context.getPackageName(), 0); } catch (NameNotFoundException e) { e.printStackTrace(); } Intent i = new Intent("miui.intent.action.APP_PERM_EDITOR"); i.setClassName("com.android.settings", "com.miui.securitycenter.permission.AppPermissionsEditor"); i.putExtra("extra_package_uid", info.applicationInfo.uid); try { context.startActivity(i); } catch (Exception e) { Toast.makeText(this.getContext(), "只有MIUI才可以設定哦", Toast.LENGTH_SHORT).show(); }
透過我的研究找到了,方法,透過intent,然後傳遞自己的應用ID,這樣就可以跳到自己的應用設定頁,否則就跳到隨機一個設定頁 程式碼其實很簡單,大家絕對能看懂,不說了 PackageManager pm = context.getPackageManager(); PackageInfo info = null; try { info = pm.getPackageInfo(context.getPackageName(), 0); } catch (NameNotFoundException e) { e.printStackTrace(); } Intent i = new Intent("miui.intent.action.APP_PERM_EDITOR"); i.setClassName("com.android.settings", "com.miui.securitycenter.permission.AppPermissionsEditor"); i.putExtra("extra_package_uid", info.applicationInfo.uid); try { context.startActivity(i); } catch (Exception e) { Toast.makeText(this.getContext(), "只有MIUI才可以設定哦", Toast.LENGTH_SHORT).show(); }