title: Get fragment window token
body: <p>I've an FragmentActivity with some fragments that contains EditText.
  If I open the keyboard and use my custom navigation (switching the fragments)
  the keyboard doesn't closes.</p>
  
  <p>I call that method in activity onCreate:</p>
  
  <pre><code>private void initKeyboardHandler(){
          getSupportFragmentManager().addOnBackStackChangedListener(new OnBackStackChangedListener() {
  
              @Override
              public void onBackStackChanged() {
                  InputMethodManager imm = (InputMethodManager)getSystemService(
                            Context.INPUT_METHOD_SERVICE);
                  imm.hideSoftInputFromWindow(findViewById(android.R.id.content).getWindowToken(), 0);
              }
          });
      }
  </code></pre>
  
  <p>After debugging I think the problem is in window token.
  Or it something else?</p>