android 显示和隐藏输入法框
显示输入法
val manager = context?.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager?
manager?.showSoftInput(v, InputMethodManager.SHOW_IMPLICIT)
隐藏输入法
val manager = context?.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager? if (manager?.isActive == true) { manager.hideSoftInputFromWindow( v.windowToken, InputMethodManager.HIDE_NOT_ALWAYS ) }