How to open MIUI system Activity programmatically in Android

Viewed 2336

enter image description here

Is it possible to open the above page programmatically in Android?

3 Answers

MIUI 10.

For current app:

try {
    Intent intent = new Intent();
    intent.setClassName("com.miui.powerkeeper",
    "com.miui.powerkeeper.ui.HiddenAppsConfigActivity");
    intent.putExtra("package_name", getPackageName());
    intent.putExtra("package_label", getText(R.string.app_name));
    startActivity(intent);
} catch (ActivityNotFoundException anfe) {
}

You can use jump to app detail activity on XiaoMi Phone(MIUI)

    Intent intent = new Intent(); 
    intent.setClassName("com.miui.securitycenter", "com.miui.appmanager.ApplicationsDetailsActivity");
    intent.putExtra("package_name", packageName);
    intent.putExtra("package_label", "Dev Tools");
    intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    context.startActivity(intent);

This is used by Dev Tools App, https://play.google.com/store/apps/details?id=cn.trinea.android.developertools

Related