Skip to content Skip to sidebar Skip to footer

Formatted Value Of Numberpicker Disappears Onclick

My NumberPicker in setDescendantFocusability(FOCUS_BLOCK_DESCENDANTS) mode and the setWrapSelectorWheel(false) is turned off. I formatted my Numberpicker with a simple formatter: m

Solution 1:

Looks like this is a bug Others are facing this issue too. Check this question.

This worked for me. I tested at API 24.

try {
            Field f = NumberPicker.class.getDeclaredField("mInputText");
            f.setAccessible(true);
            EditText inputText = (EditText) f.get(yourPicker);
            inputText.setFilters(new InputFilter[0]);
        } catch (Exception e) {
            e.printStackTrace();
        }

Post a Comment for "Formatted Value Of Numberpicker Disappears Onclick"