Tessa Painter
Tessa Painter

Reputation: 2022

EditText in android wear/How to input text in android wear?

I'm building an android wear app that needs to take in text input. I've tried using EditText, and it shows up fine, but when I click the textBox, no keyboard pops up. How do I get text or voice input in android wear?

EDIT: here is the code for the editText:

<EditText
    android:id="@+id/txt"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignEnd="@+id/titleTV"
    android:layout_alignStart="@+id/titleTV"
    android:layout_centerVertical="true"
    android:editable="true" />

Upvotes: 2

Views: 2065

Answers (1)

Ali Naddaf
Ali Naddaf

Reputation: 19044

Given that there is no IME on a wear device, you have a few options to capture user's input:

  • If you are working with Notifications, then there is a way to build a notification that can take a voice reply on a watch.
  • If you can, provide a set of canned responses/choices for the user to select from a list
  • If you want a more free-form input, use SpeechRecognizer to capture user's voice input as a text.

Upvotes: 1

Related Questions