如何在Android中以编程方式清除TextInputItemText
我不想用如何在Android中以编程方式清除TextInputItemText,android,android-textinputedittext,autocompletesupportfragment,Android,Android Textinputedittext,Autocompletesupportfragment,我不想用setText(“”)来清除文本。 我想模拟右十字图标的点击动作。 如何操作?基于,在文本输入文本上调用设置文本(null)使用: if (editText != null) { editText.getText().clear(); } (使用Kotlin) 参考: 它将完全执行清除图标的操作 [your ID right cross icon].setOnClickListener { [your ID edit text].text.clear() } (Aut
setText(“”)
来清除文本。
我想模拟右十字图标的点击动作。
如何操作?基于,在文本输入文本上调用设置文本(null)
使用:
if (editText != null) {
editText.getText().clear();
}
(使用Kotlin)
参考:
它将完全执行清除图标的操作
[your ID right cross icon].setOnClickListener {
[your ID edit text].text.clear()
}
(AutocompleteSupportFragment)
getSupportFragmentManager().findFragmentById(R.id.autocomplete_fragment).setText(null)