How should I use InputMethodManager.hideSoftInputFromWindow(IBinder, int) if I want to dismiss an open keyboard?
In particular, for the first argument I see lots of suggestions to pass a view's token like this:
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
View view = getCurrentFocus();
imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
In particular, I'm confused about getCurrentFocus() and the view that it returns. Can I pass any view's token? Why is view.getWindowToken() suggested? Why is it even necessary to pass a view's token?