Created
December 22, 2013 13:58
-
-
Save songzhiyong/8083040 to your computer and use it in GitHub Desktop.
How to show details for installed application on Android?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Intent intent; | |
if (android.os.Build.VERSION.SDK_INT >= 9) { | |
/* on 2.3 and newer, use APPLICATION_DETAILS_SETTINGS with proper URI */ | |
Uri packageURI = Uri.parse("package:" + pkgName); | |
intent = new Intent("android.settings.APPLICATION_DETAILS_SETTINGS", packageURI); | |
ctx.startActivity(intent); | |
} else { | |
/* on older Androids, use trick to show app details */ | |
intent = new Intent(Intent.ACTION_VIEW); | |
intent.setClassName("com.android.settings", "com.android.settings.InstalledAppDetails"); | |
intent.putExtra("com.android.settings.ApplicationPkgName", pkgName); | |
intent.putExtra("pkg", pkgName); | |
ctx.startActivity(intent); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment