Android SearchView inside a fragment closes keyboard on first click / first letter typed

33 Views Asked by At

When clicking the SearchView the keyboard opens, and when I type the first letter it closes. On the second click and further it works well.

What I found related:

  1. The SearchView is inside a fragment (didn't happen when placed in an activity)

  2. I am using WindowCompat.setDecorFitsSystemWindows(getWindow(), false); in the onCreate method of the activity. If I remove this line, strangely enough, the keyboard is hidden as soon as the SearchView is clicked, rather than after typing the first letter. On the second click and further it works well.

Any help appreciated.

0

There are 0 best solutions below