How to empty edittext without setText(“”);

后端 未结 5 1641
青春惊慌失措
青春惊慌失措 2021-01-07 20:24

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

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

EDI

5条回答
  •  灰色年华
    2021-01-07 20:40

    I had a case where a Samsung device was not blanking out text with setText(""), so I used:

    String BLANK = "\u0020"; // space character

    setText (BLANK);

    and it worked this way. It may have been a font issue.

提交回复
热议问题