Edit text will not post KEYCODE_ENTER to keylistener after setting the digits tag

I have an edit text that I taking only digits and decimals. I want it to also take fractions, and I have gotten this to work. The problem is after setting the digits tag in xml to "0123456789./ " it will no longer post the KEYCODE_ENTER to the listener when the enter button is pressed. Anyone know why this is happening?

     android:digits="1234567890./ "
     android:layout_gravity="left|center_vertical" />


I do not know why they did it this way but you can work around the problem by setting the imeOptions tag in the xml and then adding a OnEditorActionListener to the EditText.

TextView.OnEditorActionListener enterListener = new TextView.OnEditorActionListener() {
    public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {

        switch (actionId) {

            case EditorInfo.IME_ACTION_NEXT:
                Log.e("Listen","TO IT ALL");
                return true;

                return false;



Credit goes to this guy for the answer https://stackoverflow.com/a/25136275/4491275

Need Your Help

C++ - Error: 'list' does not name a type (list object as member variable in class)

c++ class stdlist

I have been running into the "'xxx' does not name a type" error a lot and most posts I've read before have mentioned that this error occurs with some dependency issues. However, I can't seem to find

Java search-Arraylist


ArrayList searchList = new ArrayList();