First of all this question is not about how to hide keyboard programmatically.
We all know that we can get keyboard to appear automatically for EditText by getting focus on start and android:windowSoftInputMode="stateVisible".
Question: I have an EditText in a Fragment being focused and keyboard is shown. I navigate to another Fragment and the keyboard remains shown. How can i get the keyboard to hide automatically when the EditText (that the keyboard is for) is no longer visible?
Yes i could have hide the keyboard programmatically but i can't shake off the feeling that there must be a way to dismiss the keyboard automatically when it can be shown automatically.