2

I am using inputType = "number|text" inside TextInputEditText when I focus on this, It lets me type number only, It allows to navigate to text keyboard but not letting me type text.

Here is the code snippet:

<android.support.design.widget.TextInputLayout
    android:id="@+id/availableRoof"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_below="@+id/radio_groupPcOfInstltion"
    android:visibility="visible">

    <android.support.design.widget.TextInputEditText
        android:id="@+id/avlbleRoofTextField"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="Available Roof/Ground Area(sq.ft.)"
        android:inputType="number|text"
        android:text=""
        android:textSize="13sp" />

</android.support.design.widget.TextInputLayout>

Please suggest a solution, so that I can type text and number both.

Milind Mevada
  • 3,145
  • 1
  • 14
  • 22
Shishupal Shakya
  • 1,632
  • 2
  • 18
  • 41

3 Answers3

1

Just use input type text for getting the all possible options and textVisiblePassword for removing the suggestion and show number in one keyboard.

android:inputType="text"

OR

android:inputType="textVisiblePassword"
Faysal Ahmed
  • 7,501
  • 5
  • 28
  • 50
  • Be careful with `textVisiblePassword`, it may launch "Do you want to store this password in Google?" dialog. Happening i.e. on Pixel 6, Android 12. For non-credentials and insensitive information, `inputType="text"` is better option. – Tom11 Sep 05 '22 at 07:16
0

You need to set the inputType as text, so that you can easily enter text as well as numbers in the TextInputEditText.

Use: android:inputType="text"

Nitin Gurbani
  • 1,220
  • 6
  • 16
0

Try adding these properties:

android:digits="abcdefghijklmnopqrstuvwxyz1234567890"
android:inputType="textVisiblePassword"
Yash
  • 3,438
  • 2
  • 17
  • 33