title: Hide keyboard when switching tabs in android
body: <p>I have created tab strip with custom classes and I am displaying one fragment in each tab. When the keyboard is open and I switch to tab then second fragment is getting called but the keyboard is not hiding.</p>
  
  <p>I am using the code below in onCreateView() in both fragment but it's not working:</p>
  
  <pre><code>//To Hide Soft 
  getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
  </code></pre>