显示输入法
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 ) }