У меня есть edittext и spinner. Когда я касаюсь edittext, появляется клавиатура, после завершения редактирования текста я касаюсь стрелки раскрывающегося списка счетчика, но клавиатура не исчезает автоматически. Пожалуйста, дайте мне некоторое решение. Я пробовал этот код
InputMethodManager imm=(InputMethodManager)getApplicationContext().getSystemService(SetUpProfileActivity.this.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(mDateOfBirth.getWindowToken(), 0);
Это xml
<LinearLayout
android:id="@+id/outerlayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="10dp"
>
<TextView
android:id="@+id/name_view"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/profile_name"
android:textColor="#ffffff" />
<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" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="@string/dateofbirth"
android:textColor="#ffffff" />
<Spinner
android:id="@+id/dob"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:background="@drawable/dropdown" />