Android: On Single back key press soft keyboard should be hidden and activity should be finished as well, how to make it possible?
I have one activity which has one EditText component and three buttons. Clicking on EditText Components pops a soft key board.
I have received a bug stating on single Back Key press you should go to the previous activity. Currently only soft key board is hidden.
How should I solve this issue?
I have got suggestion that I should make a custom 'Text box'. But I can not figure out how can I do this. Or How can it solve my problem.
Making a custom edit text or text box will solve this problem? If yes how?
EDIT: IF its impossible will you please tell me how its impossible?
Edit 2: None of the key listeners provided by api works in this case. If soft keyboard is shown pressing back button will hide the key board first... our implementation works only after that.
Edit 3: Anybody h开发者_Go百科aving any idea??????
Yes, you can. See my answer here: Intercept back button from soft keyboard
add onKeyListener to your EditText and catch back key event and finish your activity. See here
精彩评论