1

In my xml, I am having TextInputLayout edittext inside NestedRecyclerView, when focus is on first edittext and I am going to focus on second edittext then keyboard is hiding and showing, on scrolling also keyboard is hiding but focus is still there. Any help will be appreciated.

Mohit
  • 11
  • 1

1 Answers1

0

implement OnTouchListener in your project code

MyRecycleView.setOnTouchListener(new OnTouchListener() {

        @Override
        public boolean onTouch(View v, MotionEvent event) {

        InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
        imm.hideSoftInputFromWindow(v.getWindowToken(), 0);

        return false;
    }
});

This might help you Implementation of RecyclerView that will dismiss keyboard

Monu Rohilla
  • 1,311
  • 5
  • 20
  • I am not using Recyclerview, only Nestedscrollview, keyboard should not hide when I am clicking on next edittext or scrolling but it is hiding and then coming again. – Mohit Oct 29 '20 at 05:13