Reprint Please specify source: http://blog.csdn.net/l1028386804/article/details/47303575
In the settings feature of the Android system, when you go to the app list, clicking on the list entry will go to the app's details screen. So can we write our own application to implement the details interface of the activation application? This is achievable, so let's take a look at how to implement this feature. No more talking, let's go straight to the subject.
First, the principle
Since versions prior to 2.2 and 2.2 have different ways of activating the application's details interface, we will first get the SDK version number of the current Android system, if the SDK version number is greater than 8, then use the activation method of the version 2.2 later, if the SDK version is less than or equal to 8, use the previous version of the call method.
Second, the realization
The implementation is very simple, here I will not put all the code out, I only give the core method code, you just use these methods directly to their own projects can.
1. Get the current Android System SDK version number code
Gets the current system SDK version number private int getsdkversion () {return android.os.Build.VERSION.SDK_INT;}
2. Activate the application's details screen
Activation activation Application Details interface//incoming parameter is the package name of the application to be activated public void Notifyappdetailview (String packagename) { int version = Getsdkversion (); Intent Intent = new Intent ()//2.3 later version calls the app details page if (Version > 8) {//Activates the system's components Intent.setaction (" Android.settings.APPLICATION_DETAILS_SETTINGS "); Intent.setdata (Uri.parse (" package: "+ PackageName)); else{ //2.2 and 2.2 Previous versions invoke the app details interface intent.setaction (Intent.action_view); Intent.addcategory (" Android.intent.category.VOICE_LAUNCH "); Intent.putextra (" pkg ", PackageName);} StartActivity (intent);}
Third, the Operation effect
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Android--Activate the app's details screen