title: hideSoftInputFromWindow(view.getWindowToken(), 0) not working
body: <pre><code>View view = activity.getCurrentFocus();
  
  if (view != null) {
          InputMethodManager imm = (InputMethodManager)activity.getSystemService(Context.INPUT_METHOD_SERVICE);
          imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
      }
  </code></pre>
  
  <p>I am getting view as an <code>editText</code>, but <code>imm.hideSoftInputFromWindow(view.getWindowToken(), 0)</code> always <code>returns false</code>, </p>
  
  <p>can anyone help me understand how it works and how can I fix this.</p>