Android EditText - Unable to enter value

I am new to Android development. I recently ran into a problem in EditTextsused in my application, which I am currently running in the emulator. When pressed, EditTextit gets focus, but when I enter something, I cannot enter values.

Any help would be noticeable.

<LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal"
    android:padding="0dp"
    android:weightSum="1" >

    <TextView
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight=".25"
        android:text="@string/amt"
        android:textSize="15sp" />

    <EditText
        android:id="@+id/amount"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="10dp"
        android:background="@drawable/edit_text"
        android:inputType="number" />
</LinearLayout>
+3
source share
2 answers

Delete this line from xml file

android:inputType="number"

and if you want to enter something, set the input type to EditText

 android:inputType="textNoSuggestions"
+2
source

delete this line android:inputType="number"and now it should work

0
source

All Articles