Cancelling event due to no window focus : MotionEvent

后端 未结 2 879
花落未央
花落未央 2020-12-19 19:23

Here\'s the story:

I am trying to build a guessing game in Android Studio. Where the user has to guess a number that resides between 0 and 1000. Every time the user

相关标签:
2条回答
  • 2020-12-19 20:01

    You can override:

    onKeyUp(int keyCode, KeyEvent event)
    
    0 讨论(0)
  • 2020-12-19 20:21

    Please follow below steps and let me know if it works

    1. Override dispatchKeyEvent to check is Tab or Enter is pressed.
    2. If Tab or Enter is pressed and EditTextView has focus, submit the guess.

    Let me know if you have any doubts or need a code snippet.

    0 讨论(0)
提交回复
热议问题