简体   繁体   中英

Android EditText numeric keyboard

This is my EditText xml code:

  <EditText
   android:layout_width="200dp"
   android:layout_height="wrap_content"
   android:inputType="number"/>

There are 20 EditText's in my xml. When I touch any of the EditText for the first time (after Activity is created), full keyboard (with letters) appears. Next time, when I touch some EditText numeric keboard appears (which is correct).

How to display numeric keyboard also when activity is created on first time and EditText is touched on first time?

FYI: I am using Android 5.1

Hope it will work

<EditText
android:digits="0123456789."
android:inputType="numberDecimal"
/>

OR

android:inputType="phone"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM