Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to empty edittext without setText("");

Tags:

People also ask

How do I remove text from EditText?

just use the android:hint attribute in your EditText. This text shows up when the box is empty and not focused, but disappears upon selecting the EditText box. this should be the accepted answer, +1 for simplicity.

How do you clear a textbox in Kotlin?

Use editText. getText(). clear() . This is the correct way to do this.

What does an empty EditText return?

It will return true if its empty/null.


Is there a way to reset the edittext value without setting text like:

((EditText) findViewById(R.id.yoursXmlId)).setText("");

EDIT:

Textchanged listner is called when i use setText("").