Summary of Error opening developer panel with Settings.application_development_settings

Source: Internet
Author: User

Recently encountered a problem, feel the need to record a bit.

To open the developer panel, the previous code is as follows:

Intent Intent = new Intent (settings.action_application_development_settings); context.startactivity (Intent);

The test passed on my machine, but the background feedback will crash when it is released:

Android.content.ActivityNotFoundException:No Activity found to handle Intent {Act=android.settings.application_ Development_settings}

Looked carefully, the wrong model of the OS version is 2.3, and then found a 2.3 to test. There is a real error, so the Settings.application_development_settings field is not valid in version 2.3.

In the online view of the API Settings.application_development_settings is started in API 3, so that the 2.3 time already exists. In order to figure out, downloaded the 2.3 version of the settings source code, found that the action is <action android:name= "com.android.settings.APPLICATION_DEVELOPMENT_ SETTINGS "/>, but the API appears as" Android.settings.APPLICATION_DEVELOPMENT_SETTINGS ". Then the error is here, as to which version began to change, checked for a while not found. Due to time problems, we will do a detailed query later.

But how to solve the problem? You can make version judgments and initialize intnet with a different string action. However, you can also use a different method, the code is as follows:

ComponentName componentname = new ComponentName ("Com.android.settings", "com.android.settings.DevelopmentSettings") ; Intent Intent = new Intent (); intent.setcomponent (componentname); Intent.setaction ("Android.intent.action.View"); Context.startactivity (Intent);

That way, you don't have to judge the version.

The problem is due to the version of the differences caused by their own in this area has been no systematic study, every time there is a problem to understand a little. In fact, it will be slow to solve the problem, and will not avoid such errors in advance, it seems time to find a good study of this aspect.

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.