Spell Checker Settings

In Android, I can launch the keyboard settings and input dialog using the ACTION_INPUT_METHOD_SETTINGS intent:

 getPresenter().startActivity(new Intent(Settings.ACTION_INPUT_METHOD_SETTINGS)); 

Question: How do I open the "Spell Checker" settings dialog box (available in Jelly Bean +) so that the user can enable my service?

Example: I can get language and input settings from it: Language and input settings

But I want to take the user directly to this screen: Spell checker settings

+4
source share
2 answers

Here you go:

 ComponentName componentToLaunch = new ComponentName("com.android.settings", "com.android.settings.Settings$SpellCheckersSettingsActivity"); Intent intent = new Intent(); intent.addCategory(Intent.CATEGORY_LAUNCHER); intent.setComponent(componentToLaunch); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); try { this.startActivity(intent); } catch (ActivityNotFoundException e) { //TODO } 

You can find out the names of other Acts by running Activity and find the Intent used in Logcat. The output for me was:

 I/ActivityManager( 589): START u0 {act=android.intent.action.MAIN cmp=com.android.settings/.Settings$SpellCheckersSettingsActivity} from pid 13084 
+9
source

Yes it is possible..:)

 Intent intent = new Intent(); intent.setComponent(new ComponentName("com.android.settings","com.android.settings.Settings$SpellCheckersSettingsActivity")); startActivityForResult(intent); 

We create an explicit intent, and we need to run the com.android.settings.Settings $ SpellCheckersSettingsActivity component. For Future Reference, you can use LogCat in eclipse to find any package or component that you are trying to run. Just view the ActivityManager's โ€œStart Activityโ€ messages and you will see the package name and component of any activity.

+2
source

Source: https://habr.com/ru/post/1502365/


All Articles