Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android EditText - Not able to enter value

I'm a newbie in Android development. Recently, I have been facing a problem in the EditTexts used in my app which I'm currently running in Emulator. On clicking the EditText it receives focus, but on typing something I m unable to enter values.

Any help would be appreciable.

<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>
like image 709
indu Avatar asked Mar 19 '26 09:03

indu


1 Answers

Remove this line from xml file

android:inputType="number"

and if you want to enter anything then set input type of EditText

 android:inputType="textNoSuggestions"
like image 113
Piyush Avatar answered Mar 21 '26 23:03

Piyush



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!