【发布时间】:2020-09-16 05:28:32
【问题描述】:
我知道这个问题已经被问过很多次了,但我无法得到任何解决方案。
我正在实现TextWatcher,并且我想发出网络请求,但前提是用户完成输入。
这是我的代码。
val StartFragment.textWatcher: TextWatcher
get() = object : TextWatcher {
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
searchPlaces(s)
}
override fun afterTextChanged(s: Editable?) {}
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {}
}
在执行searchPlaces(s) 之前,我如何等待确定用户是否不再输入。
【问题讨论】:
-
“我知道这个问题已经被问过很多次了,但我无法找到任何可行的解决方案”您尝试过哪些方法,为什么它们不起作用?
标签: kotlin