Android EditText force numeric keyboard but allow non-numeric chars

Calc

I need to maintain an EditText which can be inputted by the user numbers, at some cases I need to set the text of the EditText to something like 12$. So I need to be able to setText() to anything I want.

I've tried setting up an EditText with input type set to number which yields the numeric keypad and also remove the InputFilter's of that EditText - Which still does not allow me to put non numeric chars

input.setFilters(new InputFilter[] {});

Am I doing something wrong? Is there a different way to accomplish my goal, an EditText with a numeric keypad that i can programmatically insert some non numeric chars into?

aviran

This will keep it numeric but will allow the $ character, add any other special chars you need to the android:digits attribute

<EditText
        android:id="@+id/editText1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:inputType="number"
        android:digits="0123456789,$">

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

EditText with numeric keyboard and comma

From Dev

Android : How to disable Keyboard or making enable only the numeric in EditText onClick

From Dev

Android : How to disable Keyboard or making enable only the numeric in EditText onClick

From Dev

Android custom numeric keyboard

From Dev

Android custom numeric keyboard

From Dev

Extract non numeric chars between html tags

From Dev

Restrict EditText programatically to show numeric keyboard

From Dev

How to force numeric keyboard for ZipCode and Samsung Galaxy?

From Dev

Force iOS numeric keyboard with custom / currency pattern

From Dev

Force iOS numeric keyboard with custom / currency pattern

From Dev

Android Numeric EditText with multiple Lines

From Dev

How to display android numeric keyboard?

From Dev

how to replace non-numeric chars using regex

From Dev

Block numeric in EditText android using input filter

From Dev

Change "Done" button in Android numeric keyboard

From Dev

Numeric Keyboard not showing on Webview TextBox focus Android

From Dev

numeric soft keyboard in android using ndk

From Dev

Android: force keyboard to appear and focus on EditText

From Dev

Numeric EditText and TextWatcher

From Dev

Numeric EditText and TextWatcher

From Dev

Enter non-breaking space without a numeric keyboard pad?

From Dev

Numeric keyboard with decimal

From Dev

making an onscreen numeric keyboard

From Dev

Qml TextField numeric keyboard

From Dev

Numeric Keyboard with a diferent layout

From Dev

Numeric Keyboard with a diferent layout

From Dev

jquery regex replace non numeric characters but allow plus

From Dev

Change text inside specific XML Tags (get rid of non-numeric chars)

From Dev

Trigger numeric keyboard for input in Android/IOS without HTML5

Related Related

  1. 1

    EditText with numeric keyboard and comma

  2. 2

    Android : How to disable Keyboard or making enable only the numeric in EditText onClick

  3. 3

    Android : How to disable Keyboard or making enable only the numeric in EditText onClick

  4. 4

    Android custom numeric keyboard

  5. 5

    Android custom numeric keyboard

  6. 6

    Extract non numeric chars between html tags

  7. 7

    Restrict EditText programatically to show numeric keyboard

  8. 8

    How to force numeric keyboard for ZipCode and Samsung Galaxy?

  9. 9

    Force iOS numeric keyboard with custom / currency pattern

  10. 10

    Force iOS numeric keyboard with custom / currency pattern

  11. 11

    Android Numeric EditText with multiple Lines

  12. 12

    How to display android numeric keyboard?

  13. 13

    how to replace non-numeric chars using regex

  14. 14

    Block numeric in EditText android using input filter

  15. 15

    Change "Done" button in Android numeric keyboard

  16. 16

    Numeric Keyboard not showing on Webview TextBox focus Android

  17. 17

    numeric soft keyboard in android using ndk

  18. 18

    Android: force keyboard to appear and focus on EditText

  19. 19

    Numeric EditText and TextWatcher

  20. 20

    Numeric EditText and TextWatcher

  21. 21

    Enter non-breaking space without a numeric keyboard pad?

  22. 22

    Numeric keyboard with decimal

  23. 23

    making an onscreen numeric keyboard

  24. 24

    Qml TextField numeric keyboard

  25. 25

    Numeric Keyboard with a diferent layout

  26. 26

    Numeric Keyboard with a diferent layout

  27. 27

    jquery regex replace non numeric characters but allow plus

  28. 28

    Change text inside specific XML Tags (get rid of non-numeric chars)

  29. 29

    Trigger numeric keyboard for input in Android/IOS without HTML5

HotTag

Archive