title: Keyboard not closing when dismiss the dialogFragment
body: <p>I have a fragment which i use to show map. From this fragment I am opening another dialog fragment which have an editText. On clicking editText the keyboard opens but when I dismiss the dialogFragment without first closing the keyboard, the dialogFragment closes as it should but the keyboard remains open. and after again touching anywhere the keyboard closes. How do I close the keyboard on dismissing the dialogFragment.</p>
  
  <p>I have already tried : 
  <code>android:windowSoftInputMode="stateAlwaysHidden"</code> in activity.</p>
  
  <p>also tried :</p>
  
  <pre><code>InputMethodManager imm =
                  (InputMethodManager) messageEditTxt.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
          if (imm.isActive())
              imm.toggleSoftInput(0, InputMethodManager.HIDE_NOT_ALWAYS);
  </code></pre>
  
  <p>in onDismiss function.</p>