我想在按下按钮后将我的 EditText 重置回空的“空间”或“提示”,该按钮将使用 EditText 字段的输入完成活动。
我与 Android 的冒险就这样开始了。
干杯。谢谢 !!
//************-------------------SEND SMS----------------*********//
btnSendSMS = (Button)findViewById(R.id.sms);
btnSendSMS.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
sendSMS(dispEd.getText().toString(),msgEd.getText().toString());
}
private void sendSMS(String phoneNumber, String msg) {
// TODO Auto-generated method stub
SmsManager sms = SmsManager.getDefault();
sms.sendTextMessage(phoneNumber, null, msg, null, null);
}
});
}
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/edit"/>
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/msg"/>
你应该试试
editText.setText("");
更新:尝试将文本设置为null
editText.setText(null);
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)