arimorty / floatingsearchview

A search view that implements a floating search bar also known as persistent search
https://github.com/arimorty/floatingsearchview/blob/master/README.md
Apache License 2.0
3.54k stars 667 forks source link

Keyboard won't hide when home button is tapped #300

Open rafaelsouzaim opened 6 years ago

rafaelsouzaim commented 6 years ago

Hi guys. Just spotted some odd behaviour. When I tap the textfield, keyboard appears, of course, as expected. Then I press home button (or the other square button, alternating app), but the keyboard doesn't hide. When I try the same thing with a normal TextView everything works as expected though.

agilangovan commented 6 years ago

I am experiencing similar behavior. Except in my case, my search bar is on another activity and when I press the home button to go back to the previous activity, the keyboard does not disappear. I don't have any keyboard toggling functions in my project so I don't know why it is not going away. And what's odd is that this doesn't occur all the time, only on random occasion.

rafaelsouzaim commented 6 years ago

Oh my bad, when I said home button I meant the circle button on the Navigation Bar. But yeah @agilangovan I think it's the same problem, in my case it happens always. For now the solution for me will be something like searchView.clearSearchFocus() inside one of the Activity's lifecycle methods. It can work for you as well.