Various methods can be found on the Internet. In the actual test, on my development machine, only the following method works, so record it.

 

Public static void HideKeyboard(View v) {InputMethodManager imm = (InputMethodManager) v.goetContext ( ).getSystemService( Context.INPUT_METHOD_SERVICE ); if ( imm.isActive( ) ) { imm.hideSoftInputFromWindow( v.getApplicationWindowToken( ) , 0 ); }}

 

 

 

 

Reference:

Blog.csdn.net/jdsjlzx/art…