Monty
Monty

Reputation: 3215

Android softkeyboard shows (A -Z) text with(1-9) digits after giving input type ="numberpassword"

I have one quesiton with me.

I am trying to find the answer but no success.

1-I have one editpasswordfield in which i can give only numeric password.

i did like this

 <EditText
            android:id="@+id/editText4"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:inputType="numberPassword"/>

and its showing the keyboard number with text. enter image description here

but i need the keyboard like this

enter image description here

i tried this

android:inputType="numberPassword|number"

and many possibilities but does not worked for me .

if i try android:inputType="number".It works but my field is password so this does not work its visible to user.

any help.

Upvotes: 1

Views: 772

Answers (1)

CRUSADER
CRUSADER

Reputation: 5472

Try this..

 EditText editText = (EditText) findViewById(R.id.editText4);
    editText.setInputType(InputType.TYPE_CLASS_NUMBER);
    editText.setTransformationMethod(PasswordTransformationMethod.getInstance());

Hope this helps....

Upvotes: 2

Related Questions