Programmatically Hide Soft Keyboard in ViewPager.OnPageChangeListener onPageSelected()?

Viewed 18115

I have a ViewPager + ActionBar with tabs. I want to make the soft keyboard hide when I "swipe" to another tab but I can't figure out how.

I've passed in my Activity to the constructor for the FragmentPageAdapter so I can call

 activity.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);

But it doesn't do anything (and it is in a reachable area of the code)...help?

5 Answers
Related