title: Hide Android soft keyboard if it is open
body: <p>I have three edit-text fields. Of these fields I want to display the soft input keyboard only for the first field and disabled for the later two fields sice these are date and time fields.</p>
  
  <pre><code>Edit-Text 1 //Show the keyboard
  Edit-Text 2 and 3 //Hide the keyboard
  </code></pre>
  
  <p>By using below code I'm able to disable the keyboard for field 2 and 3 but when the user has focus on field 1 the keyboard appears but didn't hide when user taps on field 2 or 3. Although when field 2 or 3 is tapped first no keyboard appears.</p>
  
  <pre><code>//Code to disable soft input keyboard
  public static void disableSoftInputFromAppearing(EditText editText) {
      if (Build.VERSION.SDK_INT &gt;= 11) {
          editText.setRawInputType(InputType.TYPE_CLASS_TEXT);
          editText.setTextIsSelectable(true);
      } else {
          editText.setRawInputType(InputType.TYPE_NULL);
          editText.setFocusable(true);
      }
  </code></pre>
  
  <p>How can I hide the soft input keyboard if its already open?</p>