0

im trying to get the code when user hides the keyboard to activate some methods. To do that i have implemented this listener on the editText:

cantidadET.setOnKeyListener(new View.OnKeyListener() {
            @Override
            public boolean onKey(View v, int keyCode, KeyEvent event) {
                if(event.getAction() == KeyEvent.ACTION_DOWN && (keyCode == KeyEvent.KEYCODE_ENTER || keyCode == KeyEvent.???)){
                    v.clearFocus();
                    hideKeyboardFrom(getContext(), v);
                    doCalculations();
                    return true;
                }
                return false;
            }
        });

The problem is that i cant get the keycode of the down arrow that hides the keyboard as i show on this image:

Image

I have tried to get the code using Log.d but no code is returned. So, how can i get that code or there is another way to activate the methods when user finish introducing data?

vx00
  • 16
  • 1
  • 2
  • https://stackoverflow.com/questions/25216749/soft-keyboard-open-and-close-listener-in-an-activity-in-android/38594545 – Zain Jul 06 '20 at 21:55

0 Answers0