An activity in the settings module needs to be referenced in the project. After you import the Settins.jar package in Eclipse, start it using the following methods, for example:
Intent Intent = new Intent () intent.setaction ("Android.settings.INPUT_METHOD_SETTINGS"); Intent.addcategory (" Android.intent.category.VOICE_LAUNCH "); Intent.setclass (this, datetimesettingssetupwizard.class); StartActivity ( Intent);
Compile does not error, but in the execution of the prompt: ClassNotFoundException error. Find a solution to join the three-party library on the Internet. Later a change is realized, and do not need to import Settings.jar this library.
Intent Intent = new Intent (); Intent.setaction ("Android.settings.INPUT_METHOD_SETTINGS"); ComponentName C = new ComponentName ("Com.android.settings", "com.android.settings.LanguageSettings"); Intent.setcomponent (c); Intent.addcategory ("Android.intent.category.VOICE_LAUNCH"); StartActivity (intent);
Yes, that's the way to set up componentname. There is no need to import the package, and there is no error executing.
It is unclear why the package was imported and an error occurred. It is possible that after the package is imported into the software, the actual loading, initialization is done within the space of the application. The class you want to reference is in the system's package and is not in a space, causing the class to be found.
Friends who have better explanations or have any clues, want to add in the comments. Humbly
This article will be updated as part of the review.
Import three-party package, appear classnotfoundexception