Android EditText 监听输入完成

1 EditText 添加TextChangedListener

在 TextWatcher中的 afterTextChanged 回调中添加 延迟处理的线程
editRunable 为 输入完成触发的任务

 override fun afterTextChanged(s: Editable) {
 if (editRunable != null) {
                    handler.removeCallbacks(editRunable)
                }              handler.postDelayed(editRunable,800)
}

2 软键盘的监听

软键盘监听难度 等同于 app 包活

github gay友提供的库

猜你喜欢

转载自blog.csdn.net/xiaocajiyyd/article/details/79229075