How can I launch the Android application program screen?

Can I launch the "application information" screen (that is, Menu β†’ Settings β†’ Applications β†’ Manage Applications β†’ select any application) from another application?

+46
android
Dec 12 2018-10-12
source share
6 answers

In section 2.2 and below, there are no public APIs that you can access. But you can still run InstalledAppDetails , as ManageApplications does. see here

  // utility method used to start sub activity private void startApplicationDetailsActivity() { // Create intent to start new activity Intent intent = new Intent(Intent.ACTION_VIEW); intent.setClass(this, InstalledAppDetails.class); intent.putExtra(APP_PKG_NAME, mCurrentPkgName); // start new activity to display extended information startActivityForResult(intent, INSTALLED_APP_DETAILS); } 

Conclusion : you can run the "application information" screen, as I wrote:

 private static final String SCHEME = "package"; private static final String APP_PKG_NAME_21 = "com.android.settings.ApplicationPkgName"; private static final String APP_PKG_NAME_22 = "pkg"; private static final String APP_DETAILS_PACKAGE_NAME = "com.android.settings"; private static final String APP_DETAILS_CLASS_NAME = "com.android.settings.InstalledAppDetails"; public static void showInstalledAppDetails(Context context, String packageName) { Intent intent = new Intent(); final int apiLevel = Build.VERSION.SDK_INT; if (apiLevel >= 9) { // above 2.3 intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS); Uri uri = Uri.fromParts(SCHEME, packageName, null); intent.setData(uri); } else { // below 2.3 final String appPkgName = (apiLevel == 8 ? APP_PKG_NAME_22 : APP_PKG_NAME_21); intent.setAction(Intent.ACTION_VIEW); intent.setClassName(APP_DETAILS_PACKAGE_NAME, APP_DETAILS_CLASS_NAME); intent.putExtra(appPkgName, packageName); } context.startActivity(intent); } 
+75
Jan 23 '11 at 5:29
source share

From API level 9 (Android 2.3), you can run Intent with android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS . In this way:

 packageName = "your.package.name.here" try { //Open the specific App Info page: Intent intent = new Intent(android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS); intent.setData(Uri.parse("package:" + packageName)); startActivity(intent); } catch ( ActivityNotFoundException e ) { //e.printStackTrace(); //Open the generic Apps page: Intent intent = new Intent(android.provider.Settings.ACTION_MANAGE_APPLICATIONS_SETTINGS); startActivity(intent); } 
+51
Sep 18 '13 at 13:41
source share

Old question, improved answer:

 /** * <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; } 
+13
Jul 03 '14 at 5:32
source share

In Android 2.3, you can use startActivity() on the ACTION_APPLICATION_DETAILS_SETTINGS Intent with the correct Uri to bring β€œmanage” on the screen of your application. However, this is new to Android 2.3 - I don’t know how to do this in previous versions of Android.

+8
Dec 12 2018-10-12
source share

I used the Paolo solution to open the application information settings in the SDK 23+, when the user rejected the permission request in the past and in the query request system dialog box, select the "Do not ask again" option.

But in this case, I used the getPackageName() method directly.

 Intent intent = new Intent(android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS); intent.setData(Uri.parse("package:" + getPackageName())); startActivity(intent); 
+8
Oct 23 '15 at 8:51
source share
 startActivity(new Intent(android.provider.Settings.ACTION_APPLICATION_SETTINGS)); 

will bring you to the list of settings / applications. If you want to open one specific application, I think that in 2.2 and below there is no way, so you will need to go (not necessarily proposed, because it is unofficial) way:

 final Intent i = new Intent("android.intent.action.VIEW"); i.setComponent(new ComponentName("com.android.settings","com.android.settings.InstalledAppDetails")); i.putExtra(...); // need to figure out the correct extra, probably app package name startActivity(i); 

But note that this is not recommended because it is not an official API / intent (filter) and therefore may change in the future.

+6
Dec 12 2018-10-12
source share