
This solution works for me perfectly.ĬustomEditText.java public class CustomEditText extends EditText else if (event.action = KeyEvent.ACTION_UP & !event.isCanceled & state. After this, one back press enough for solve your problem.

And then you have to implement onKeyPreIme method which controls KeyEvent.KEYCODE_BACK. Initially, you have to create custom edit text that extends EditText. This app is compatible with any Android device that supports accessibility service. It supports a wide variety of hardware and software back buttons, including phones, tablets, and operating systems. With this app, it is easier and faster to access the menu.

Its help when the phone is broken, or something happened with the. OnKeyDown() and onBackPressed() doesn't work for this case. It allows you to rewind the navigation history to find the last navigation destination. Back button apk is a great android app to get soft keys options on your android screen.
