0

I have a Chip component, and through its onClick event, I would like to bring up the keyboard.

Currently, I am using the RemoteInput API:

val intent: Intent = RemoteInputIntentHelper.createActionRemoteInputIntent()
val remoteInputs: List<RemoteInput> = listOf(
    RemoteInput
        .Builder(inputTextKey)
        .setLabel("Note")
        .wearableExtender {
            setEmojisAllowed(false)
            setInputActionType(EditorInfo.IME_ACTION_DONE)
        }
        .build()
)
RemoteInputIntentHelper.putRemoteInputsExtra(intent, remoteInputs)

with the Chip component:

Chip(
    onClick = { launcher.launch(intent) },
    ...)

This works fine, however it first brings up a menu to choose the input type: either Voice Input or Keyboard Input (cf. image).

Is there a way to instantly bring up the Keyboard input, without going through this intermediate menu?

I have read most of the documentation for RemoteInput and tried modifying fields through the setters exposed in the API, but none of them seem to impact the input type (aside from setEmojisAllowed).

JoZ
  • 1
  • 3

1 Answers1

0

When installing the .apk to my own watch to test the app, I noticed it had the desired behaviour, i.e. opening the keyboard directly without the intermediate menu.

So it seems like the issue is one of discrepency between the Android Studio emulator and the physical watch. Haven't found the root cause for that, but for now my problem is solved. :)

JoZ
  • 1
  • 3