title: how to hide virtual keyboard on touch of a spinner
body: <p>I have a edittext and a spinner. When I touch on the edittext the keyboard appears, after completed the text editing I touch on the dropdown arrow of the spinner but the keyboard doesn't disappears automatically. Please give me some solution.
  I tried this code </p>
  
  <pre><code> InputMethodManager imm=(InputMethodManager)getApplicationContext().getSystemService(SetUpProfileActivity.this.INPUT_METHOD_SERVICE);
          imm.hideSoftInputFromWindow(mDateOfBirth.getWindowToken(), 0);
  </code></pre>
  
  <p>This is the xml</p>
  
  <pre><code>&lt;LinearLayout
              android:id="@+id/outerlayout"
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:orientation="vertical"
              android:padding="10dp" 
  
              &gt;
  
              &lt;TextView
                  android:id="@+id/name_view"
                  android:layout_width="fill_parent"
                  android:layout_height="wrap_content"
                  android:text="@string/profile_name"
                  android:textColor="#ffffff" /&gt;
  
              &lt;EditText
                  android:id="@+id/profile_name"
                  android:layout_width="fill_parent"
                  android:layout_height="wrap_content"
                  android:layout_marginTop="5dp"
                  android:background="@drawable/txtbox"
                  android:singleLine="true" /&gt;
  
              &lt;TextView
                  android:layout_width="fill_parent"
                  android:layout_height="wrap_content"
                  android:layout_marginTop="5dp"
                  android:text="@string/dateofbirth"
                  android:textColor="#ffffff" /&gt;
  
              &lt;Spinner
                  android:id="@+id/dob"
                  android:layout_width="fill_parent"
                  android:layout_height="wrap_content"
                  android:layout_marginTop="5dp"
                  android:background="@drawable/dropdown" /&gt;
  </code></pre>