Android--Activate the app's details screen

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.