I am writing an app for listing applications installed on the system. I am using PackageManager and queryIntentActivities() to get list of applications.
I am able to start it, uninstall it (using ACTION_DELETE), but I have no idea how to show details (where user can force stop, move to/from SD card, see disk space usage etc)?
I tried ACTION_VIEW, but it also shows uninstall dialog on 2.1 (did not check other versions yet). I also didn't find anything except for an unanswered question on android-dev mailing list.
Solution combined with answer above and http://groups.google.com/group/android-developers/browse_thread/thread/1d4607eb370b1fe6/3cd4b85c310fe112?show_docid=3cd4b85c310fe112&pli=1:
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);
}
Starting with API Level 9 (a.k.a., Android 2.3), you should be able to use ACTION_APPLICATION_DETAILS_SETTINGS
for this. There is no way to get to this screen in previous versions of Android.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With