如何清空的EditText没有的setText(QUOT;"); [英] How to empty edittext without setText("");

查看:139
本文介绍了如何清空的EditText没有的setText(QUOT;");的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法来重置价值的EditText没有设置类似的文字:

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

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

编辑:

当我使用的setText()框TextChanged听者中被调用。

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

推荐答案

另一种选择是:<一href=\"http://developer.android.com/reference/android/text/Editable.html#clear%28%29\"><$c$c>EditText.getText().clear();但你总得去投:

Another option is: EditText.getText().clear(); But you'll have to cast anyway:

((的EditText)findViewById(R.id.yoursXmlId))的getText()清();

这篇关于如何清空的EditText没有的setText(QUOT;&QUOT;);的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆