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.