Presumably, based on the answers to this question in other places (I'm still trying to find a working method myself), the desired token is from your TextView.getWindowToken ().
However, this does not work for me, and I have seen many people with the same complaint.
[edit]
Using the token described above, I was lucky to hide the keyboard with hideSoftInputFromWindow instead of hideSoftInputFromInputMethod. Although, since I did not understand the difference between these functions to begin with, I cannot understand your actual question. Excuse me!
[/ Edit]
source share