When I call the android settings menu to enable my input method, I would like the menu to flash to highlight the correct item in the list for my keyboard. I saw this happen when installing another keyboard, but can't seem to find the correct code/identifier.
Currently my code looks like this.
val imeIntent = Intent(Settings.ACTION_INPUT_METHOD_SETTINGS); imeIntent.putExtra(Settings.EXTRA_INPUT_METHOD_ID,"com.storyfeet.keyseypeasy") startActivity(imeIntent); It works, in that I can turn on the keyboard, but it doesn't highlight the correct row.
I assume I have to get to the correct ID for my service:
<service android:name=".KeyseyPeasy" android:exported="true" android:label="@string/app_name" android:permission="android.permission.BIND_INPUT_METHOD"> <intent-filter> <action android:name="android.view.InputMethod" /> </intent-filter> <meta-data android:name="android.view.im" android:resource="@xml/method" /> </service> I have also tried: ".KeyseyPeasy" "com.storyfeet.keyseypeasy.KeyseyPeasy"
and a few other variations
getId()value fromInputMethodInfo, but it is unclear to me how to get your own ID.ComponentName#flattenToShortString(): developer.android.com/reference/android/view/inputmethod/…. You can assemble that manually – e.g.,"com.storyfeet.keyseypeasy/.KeyseyPeasy"- or create aComponentNamefirst, if you'd rather; e.g.,ComponentName(context, KeyseyPeasy::class.java).flattenToShortString().