Solution: You can force the android to close the virtual keyboard. hideSoftInputFromWindow function to close the virtual keyboard Code: View myview = this . getCurrentFocus (); if (myview != null ) { InputMethodManager inm = ( InputMethodManager ) getSystemService ( Context . INPUT_METHOD_SERVICE ); inm . hideSoftInputFromWindow ( view . getWindowToken (), 0 ); }