Search code examples
androidandroid-layoutandroid-edittexttextselection

Why won't my EditText element accept any input on Android?


Here's the code for my EditText element:

<EditText
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textIsSelectable="true"
    android:text=""
    android:id="@+id/myTextEdit"/>

The entire app builds and I'm not using this element in code yet, but when it shows up on the screen I cannot type into the element.

This EditText element will not accept text any time I try to type into it.

Do you know why?


Solution

  • The entire reason it fails is because the EditText element is already selectable. For some reason adding the following property causes the element to be uneditable:

    android:textIsSelectable="true"
    

    I removed the property from the layout and I could type text into the element.