Now, I try to hide the softkeyboard when user touch outside the keyboard:
((InputMethodManager) getSystemService(INPUT_METHOD_SERVICE)) .hideSoftInputFromWindow(
Surely you can use:
getContentView().getWindowToken()
or you can refer to SO Quest