1

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

2
  • This suggests that it is the getId() value from InputMethodInfo, but it is unclear to me how to get your own ID. Commented Dec 30, 2024 at 21:38
  • The ID is defined as ComponentName#flattenToShortString(): developer.android.com/reference/android/view/inputmethod/…. You can assemble that manually – e.g., "com.storyfeet.keyseypeasy/.KeyseyPeasy" - or create a ComponentName first, if you'd rather; e.g., ComponentName(context, KeyseyPeasy::class.java).flattenToShortString(). Commented Dec 30, 2024 at 23:43

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.