我不想使用
setText("")
来清除文本。
我想模拟点击右侧交叉图标的操作。
怎样做呢?setText("")
来清除文本。
我想模拟点击右侧交叉图标的操作。
怎样做呢?使用:
if (editText != null) {
editText.getText().clear();
}
[your ID right cross icon].setOnClickListener {
[your ID edit text].text.clear()
}
(AutocompleteSupportFragment)
getSupportFragmentManager().findFragmentById(R.id.autocomplete_fragment).setText(null)
它将完全执行清除图标所做的操作。