How to detect Android back button when opening keyboard?
I need to hide the list if the keyboard is hidden.
I used below code
final View activityRootView = findViewById(R.id.globallayout); activityRootView.getViewTreeObserver().addOnGlobalLayoutListener(new OnGlobalLayoutListener() { @Override public void onGlobalLayout() { int heightDiff = activityRootView.getRootView().getHeight() - activityRootView.getHeight(); if (heightDiff > 55) {
But if the list contains more than 500 lines. the keyboard is not hiding properly. It takes 5 to 10 seconds.
How to solve this?
Rvg source share