Open or launch the soft keyboard in number or symbol mode

I searched for a long time to get the answer, and now it's time to ask my question on stackoverflow.

I can’t imagine that the Android OS does not have the ability to allow the launch of the soft keyboard in the number / symbol code and give the user the opportunity to return to the letter?

I have already tried this, but to no avail:

in code:

editTextHouseNumber.setRawInputType(InputType.TYPE_CLASS_NUMBER); editTextHouseNumber.setInputType(InputType.TYPE_CLASS_NUMBER); 

xmlLayoutFile:

 android:inputType="textPostalAddress" android:inputType="number|textCapCharacters" android:inputType="number" 

please, help

+6
source share
2 answers

As I understand it, your problem is that you want to open the keyboard with the type of number as soon as your screen starts. Try this so that it is what you want.

 <EditText android:layout_width="wrap_content" android:layout_height="wrap_content" android:inputType="number"> <requestFocus/> </EditText> 
0
source

Try to look at it.

http://android-developers.blogspot.com/2009/04/creating-input-method.html

(EditorInfo.inputType and EditorInfo.TYPE_CLASS_MASK) can be one of many different values, including:

TYPE_CLASS_NUMBER TYPE_CLASS_DATETIME TYPE_CLASS_PHONE TYPE_CLASS_TEXT

  • TYPE_CLASS_NUMBER
  • TYPE_CLASS_DATETIME
  • TYPE_CLASS_PHONE
  • TYPE_CLASS_TEXT
0
source

Source: https://habr.com/ru/post/924153/


All Articles