Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to programmatically clear TextInputEditText in Android

I do not want to setText("") to clear the text. I want to simulator the click action of right cross icon. How to do it?

like image 833
red23jordan Avatar asked Sep 16 '26 16:09

red23jordan


1 Answers

Based on the implementation of that icon, call setText(null) on the TextInputEditText.

like image 128
CommonsWare Avatar answered Sep 18 '26 06:09

CommonsWare