Searchview Use Multiple Comma With Numeric Keyboard
I'm trying to get my SearchView to use multiple comma and numbers. Unfortunately I'm stuck with be able to use only one comma using the following settings: SearchView searchView =
Solution 1:
val searchView: SearchView = search.actionView as SearchView
val editText = searchView.findViewById<EditText>(R.id.search_src_text)
editText.inputType = InputType.TYPE_CLASS_NUMBER + InputType.TYPE_NUMBER_FLAG_DECIMAL
editText.keyListener = DigitsKeyListener.getInstance("0123456789,")
Solution 2:
I think you'll need to override the OnKeyDown() listener and filter the input there. You may find this link usefull: example code for OnKeyDown() listener
Post a Comment for "Searchview Use Multiple Comma With Numeric Keyboard"