Skip to main content
remove "UPDATE:".
Source Link
double-beep
  • 5.7k
  • 19
  • 43
  • 50

This is not possible. I tried to do so, too. I could figure out the package name and the activity which will be started. But in the end you will get a security exception because of a missing permission you can't declare.

UPDATE:

 

Regarding the other answer I also recommend to open the App settings screen. I do this with the following code:

public static void startInstalledAppDetailsActivity(final Activity context) { if (context == null) { return; } final Intent i = new Intent(); i.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS); i.addCategory(Intent.CATEGORY_DEFAULT); i.setData(Uri.parse("package:" + context.getPackageName())); i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); i.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY); i.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); context.startActivity(i); } 

As I don't want to have this in my history stack I remove it using intent flags.

Kotlin Version:

val intent = Intent(ACTION_APPLICATION_DETAILS_SETTINGS) with(intent) { data = Uri.fromParts("package", requireContext().packageName, null) addCategory(CATEGORY_DEFAULT) addFlags(FLAG_ACTIVITY_NEW_TASK) addFlags(FLAG_ACTIVITY_NO_HISTORY) addFlags(FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS) } startActivity(intent) 

This is not possible. I tried to do so, too. I could figure out the package name and the activity which will be started. But in the end you will get a security exception because of a missing permission you can't declare.

UPDATE:

Regarding the other answer I also recommend to open the App settings screen. I do this with the following code:

public static void startInstalledAppDetailsActivity(final Activity context) { if (context == null) { return; } final Intent i = new Intent(); i.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS); i.addCategory(Intent.CATEGORY_DEFAULT); i.setData(Uri.parse("package:" + context.getPackageName())); i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); i.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY); i.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); context.startActivity(i); } 

As I don't want to have this in my history stack I remove it using intent flags.

Kotlin Version:

val intent = Intent(ACTION_APPLICATION_DETAILS_SETTINGS) with(intent) { data = Uri.fromParts("package", requireContext().packageName, null) addCategory(CATEGORY_DEFAULT) addFlags(FLAG_ACTIVITY_NEW_TASK) addFlags(FLAG_ACTIVITY_NO_HISTORY) addFlags(FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS) } startActivity(intent) 

This is not possible. I tried to do so, too. I could figure out the package name and the activity which will be started. But in the end you will get a security exception because of a missing permission you can't declare.

 

Regarding the other answer I also recommend to open the App settings screen. I do this with the following code:

public static void startInstalledAppDetailsActivity(final Activity context) { if (context == null) { return; } final Intent i = new Intent(); i.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS); i.addCategory(Intent.CATEGORY_DEFAULT); i.setData(Uri.parse("package:" + context.getPackageName())); i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); i.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY); i.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); context.startActivity(i); } 

As I don't want to have this in my history stack I remove it using intent flags.

Kotlin Version:

val intent = Intent(ACTION_APPLICATION_DETAILS_SETTINGS) with(intent) { data = Uri.fromParts("package", requireContext().packageName, null) addCategory(CATEGORY_DEFAULT) addFlags(FLAG_ACTIVITY_NEW_TASK) addFlags(FLAG_ACTIVITY_NO_HISTORY) addFlags(FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS) } startActivity(intent) 

This is not possible. I tried to do so, too. I could figure out the package name and the activity which will be started. But in the end you will get a security exception because of a missing permission you can't declare.

UPDATE:

Regarding the other answer I also recommend to open the App settings screen. I do this with the following code:

 public static void startInstalledAppDetailsActivity(final Activity context) { if (context == null) { return; } final Intent i = new Intent(); i.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS); i.addCategory(Intent.CATEGORY_DEFAULT); i.setData(Uri.parse("package:" + context.getPackageName())); i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); i.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY); i.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); context.startActivity(i); } 
public static void startInstalledAppDetailsActivity(final Activity context) { if (context == null) { return; } final Intent i = new Intent(); i.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS); i.addCategory(Intent.CATEGORY_DEFAULT); i.setData(Uri.parse("package:" + context.getPackageName())); i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); i.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY); i.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); context.startActivity(i); } 

As I don't want to have this in my history stack I remove it using intent flags.

Kotlin Version:

val intent = Intent(ACTION_APPLICATION_DETAILS_SETTINGS) with(intent) { data = Uri.fromParts("package", requireContext().packageName, null) addCategory(CATEGORY_DEFAULT) addFlags(FLAG_ACTIVITY_NEW_TASK) addFlags(FLAG_ACTIVITY_NO_HISTORY) addFlags(FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS) } startActivity(intent) 
val intent = Intent(ACTION_APPLICATION_DETAILS_SETTINGS) with(intent) { data = Uri.fromParts("package", requireContext().packageName, null) addCategory(CATEGORY_DEFAULT) addFlags(FLAG_ACTIVITY_NEW_TASK) addFlags(FLAG_ACTIVITY_NO_HISTORY) addFlags(FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS) } startActivity(intent) 

This is not possible. I tried to do so, too. I could figure out the package name and the activity which will be started. But in the end you will get a security exception because of a missing permission you can't declare.

UPDATE:

Regarding the other answer I also recommend to open the App settings screen. I do this with the following code:

 public static void startInstalledAppDetailsActivity(final Activity context) { if (context == null) { return; } final Intent i = new Intent(); i.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS); i.addCategory(Intent.CATEGORY_DEFAULT); i.setData(Uri.parse("package:" + context.getPackageName())); i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); i.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY); i.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); context.startActivity(i); } 

As I don't want to have this in my history stack I remove it using intent flags.

Kotlin Version:

val intent = Intent(ACTION_APPLICATION_DETAILS_SETTINGS) with(intent) { data = Uri.fromParts("package", requireContext().packageName, null) addCategory(CATEGORY_DEFAULT) addFlags(FLAG_ACTIVITY_NEW_TASK) addFlags(FLAG_ACTIVITY_NO_HISTORY) addFlags(FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS) } startActivity(intent) 

This is not possible. I tried to do so, too. I could figure out the package name and the activity which will be started. But in the end you will get a security exception because of a missing permission you can't declare.

UPDATE:

Regarding the other answer I also recommend to open the App settings screen. I do this with the following code:

public static void startInstalledAppDetailsActivity(final Activity context) { if (context == null) { return; } final Intent i = new Intent(); i.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS); i.addCategory(Intent.CATEGORY_DEFAULT); i.setData(Uri.parse("package:" + context.getPackageName())); i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); i.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY); i.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); context.startActivity(i); } 

As I don't want to have this in my history stack I remove it using intent flags.

Kotlin Version:

val intent = Intent(ACTION_APPLICATION_DETAILS_SETTINGS) with(intent) { data = Uri.fromParts("package", requireContext().packageName, null) addCategory(CATEGORY_DEFAULT) addFlags(FLAG_ACTIVITY_NEW_TASK) addFlags(FLAG_ACTIVITY_NO_HISTORY) addFlags(FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS) } startActivity(intent) 

This is not possible. I tried to do so, too. I could figure out the package name and the activity which will be started. But in the end you will get a security exception because of a missing permission you can't declare.

UPDATE:

Regarding the other answer I also recommend to open the App settings screen. I do this with the following code:

 public static void startInstalledAppDetailsActivity(final Activity context) { if (context == null) { return; } final Intent i = new Intent(); i.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS); i.addCategory(Intent.CATEGORY_DEFAULT); i.setData(Uri.parse("package:" + context.getPackageName())); i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); i.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY); i.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); context.startActivity(i); } 

As I don't want to have this in my history stack I remove it using intent flags.

Kotlin Version:

val intent = Intent(ACTION_APPLICATION_DETAILS_SETTINGS) with(intent) { data = Uri.fromParts("package", requireContext().packageName, null) addCategory(CATEGORY_DEFAULT) addFlags(FLAG_ACTIVITY_NEW_TASK) addFlags(FLAG_ACTIVITY_NO_HISTORY) addFlags(FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS) } startActivity(intent) 

This is not possible. I tried to do so, too. I could figure out the package name and the activity which will be started. But in the end you will get a security exception because of a missing permission you can't declare.

UPDATE:

Regarding the other answer I also recommend to open the App settings screen. I do this with the following code:

 public static void startInstalledAppDetailsActivity(final Activity context) { if (context == null) { return; } final Intent i = new Intent(); i.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS); i.addCategory(Intent.CATEGORY_DEFAULT); i.setData(Uri.parse("package:" + context.getPackageName())); i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); i.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY); i.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); context.startActivity(i); } 

As I don't want to have this in my history stack I remove it using intent flags.

This is not possible. I tried to do so, too. I could figure out the package name and the activity which will be started. But in the end you will get a security exception because of a missing permission you can't declare.

UPDATE:

Regarding the other answer I also recommend to open the App settings screen. I do this with the following code:

 public static void startInstalledAppDetailsActivity(final Activity context) { if (context == null) { return; } final Intent i = new Intent(); i.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS); i.addCategory(Intent.CATEGORY_DEFAULT); i.setData(Uri.parse("package:" + context.getPackageName())); i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); i.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY); i.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); context.startActivity(i); } 

As I don't want to have this in my history stack I remove it using intent flags.

Kotlin Version:

val intent = Intent(ACTION_APPLICATION_DETAILS_SETTINGS) with(intent) { data = Uri.fromParts("package", requireContext().packageName, null) addCategory(CATEGORY_DEFAULT) addFlags(FLAG_ACTIVITY_NEW_TASK) addFlags(FLAG_ACTIVITY_NO_HISTORY) addFlags(FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS) } startActivity(intent) 
added 6 characters in body
Source Link
Dhaval Parmar
  • 19k
  • 8
  • 84
  • 183
Loading
adds alternative solution
Source Link
Thomas R.
  • 8.1k
  • 3
  • 32
  • 39
Loading
Source Link
Thomas R.
  • 8.1k
  • 3
  • 32
  • 39
Loading