3

I am developing App that has EditText in List Item View. which accept the numeric value and list of values with '+' sign. on submit a function is called which evaluate that string and adds the values present in that string separated by '+'. Now the problem is i had set


'inputType="number'


to the EditText box but in numeric keyBoard '+' sign is not present. I tried to use 'digits=0123456789+' but not worked

Vinayak Khedkar
  • 504
  • 5
  • 13

2 Answers2

6

If you'd like an input method for entering a phone number, use the "phone" value:

Use inputType="phone"

Reference here

Zubair Ahmed
  • 2,857
  • 2
  • 27
  • 47
1

As Zubair suggested inputType="phone" popup perfect keyboard for me. But to avoid extra character I did use digits="0123456789+"

<EditText
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:id="@+id/enteramount"
                android:hint="Amount"
                android:textSize="@dimen/Heading"
                android:padding="5dp"
                android:layout_marginRight="5dp"
                android:inputType="phone"
                android:digits="0123456789+"
                android:background="@drawable/edit_text_bg"/>

This may be useful to someone.

Zubair Ahmed
  • 2,857
  • 2
  • 27
  • 47
Vinayak Khedkar
  • 504
  • 5
  • 13