在自定义类中
@Override
public boolean onTouchEvent(MotionEvent event) {
if (!isFocused()) {
if (messageViewListener!=null){
messageViewListener.onHiderBottomBar();
}
// 隐藏键盘
IBinder token = sendContainer.getWindowToken();
InputMethodManager inputMethodManager = (InputMethodManager) getContext()
.getSystemService(Context.INPUT_METHOD_SERVICE);
inputMethodManager.hideSoftInputFromWindow(token,
InputMethodManager.HIDE_NOT_ALWAYS);
}
return super.onTouchEvent(event);
}
网友评论