Shishupal Shakya
Shishupal Shakya

Reputation: 1672

inputType = "number|text" not working - Android

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.

Upvotes: 2

Views: 3519

Answers (3)

Faysal Ahmed
Faysal Ahmed

Reputation: 7669

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"

Upvotes: 1

Yash
Yash

Reputation: 3576

Try adding these properties:

android:digits="abcdefghijklmnopqrstuvwxyz1234567890"
android:inputType="textVisiblePassword"

Upvotes: 0

Nitin Gurbani
Nitin Gurbani

Reputation: 1240

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"

Upvotes: 0

Related Questions