user1231357 user1231357 - 17 days ago 5
Java Question

EditText not working on specific Android device

I have this edit text that's suppose to display the number keypad. It does for all my android emulators and some test devices I have except for the Samsung S3 mini which displays the alpha keyboard. Why is that, and how can I fixed this? My xml is below and I do nothing special in code.

<EditText
android:id="@+id/amount"
android:layout_width="0dp"
android:layout_height="match_parent"
android:hint="0"
android:scrollHorizontally="true"
android:digits="0123456789.,"
android:inputType="numberDecimal"
android:layout_weight="2"
android:background="#fff"/>

Answer

I've sometimes had to use the 'phone' input type instead. It depends if that will give all the characters required. Samsung tends to be more customised than one might have guessed. This is a link https://developer.android.com/training/keyboard-input/style.html#Type to the android docs.