Stack Overflow archive
17 score

How can I start android application info screen programmatically?

score
17
question views
49.5K
license
CC BY-SA 3.0

Old question, improved answer:

java
/**
 * <p>Intent to show an applications details page in (Settings) com.android.settings</p>
 * 
 * @param context       The context associated to the application
 * @param packageName   The package name of the application
 * @return the intent to open the application info screen.
 */
public static Intent newAppDetailsIntent(Context context, String packageName) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) {
        Intent intent = new Intent(android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        intent.setData(Uri.parse("package:" + packageName));
        return intent;
    } else if (Build.VERSION.SDK_INT == Build.VERSION_CODES.FROYO) {
        Intent intent = new Intent(Intent.ACTION_VIEW);
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        intent.setClassName("com.android.settings",
                "com.android.settings.InstalledAppDetails");
        intent.putExtra("pkg", packageName);
        return intent;
    }
    Intent intent = new Intent(Intent.ACTION_VIEW);
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    intent.setClassName("com.android.settings",
            "com.android.settings.InstalledAppDetails");
    intent.putExtra("com.android.settings.ApplicationPkgName", packageName);
    return intent;
}

Originally posted on Stack Overflow. Public user contributions are licensed under Creative Commons Attribution-ShareAlike.