0

Here is my code:

searchEditText.setOnKeyListener(new OnKeyListener() {
        public boolean onKey(View v, int keyCode, KeyEvent event) {
            if (event.getAction() == KeyEvent.ACTION_DOWN) {

                Toast.makeText(AlapSlidingActivity.this, "keycode: "+keyCode, Toast.LENGTH_LONG).show();                    

            }
            return false;
        }
    });

For some reason this code executes well on my Samsung Galaxy S3 Mini, and it is toasts the message for hitting enter: "keycode: 66"

But with an Alcatel onetouch it is not toasts anything. For hitting back button, both devices toasts "keycode: 4" that is fine, but hitting "enter" on the Alcatel does nothinh.

Any ideas?

Adam Varhegyi
  • 11,307
  • 33
  • 124
  • 222

0 Answers0