I know this is too late, but it can help someone. Based on the platform source (froyo), I create one function that opens the settings page for a specific package. It works in an emulator, but I have never tried on a real device. I don't know if it works on API <8.
There he is:
public boolean startFroyoInstalledAppDetailsActivity(String packagename) { boolean result = false; Intent i = new Intent(); i.setClassName("com.android.settings", "com.android.settings.InstalledAppDetails"); i.setAction(Intent.ACTION_VIEW); i.putExtra("pkg", packagename); i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); try { cx.startActivity(i); result = true; } catch (Exception ex) { result = false; } return result; }
Based on your code, I also create a version of Gingerbread that works on real devices with API levels 9, 10, 11, 12, 13, 14 and 15, but it can be safely called API 8, but in this case it will return false.
There he is:
public boolean startGingerbreadInstalledAppDetailsActivity(String packagename) { boolean result = false; Intent i = new Intent(); i.setAction("android.settings.APPLICATION_DETAILS_SETTINGS"); i.addCategory(Intent.CATEGORY_DEFAULT); i.setData(Uri.parse("package:" + packagename)); i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); try { cx.startActivity(i); result = true; } catch (Exception ex) { result = false; } return result; }
source share