How to add text to editext

ぐ巨炮叔叔 提交于 2019-12-01 19:43:09

try this code

String title = bundle.getString("number1");
EditText editText = (EditText) findViewById(R.id.editText1);
editText.append(title);

if you want to set the only new value use this

editText.setText(title);

Should be as simple as:

editText.setText("hello");

In your code:

EditText editText=(EditText)findViewById(R.id.x);
editText.setText("hello");

You'd need editText.setText(editText.getText() + "string");.

EditText et = (EditText) findViewById(R.id.editText1);
et.setText(et.getText() + title);

Set edit text to the previuos value plus the new value.

EditText et = (EditText) findViewById(R.id.editText1);
et.setText(et.GetText() + title);
String title = bundle.getString("number1");
EditText editText = (EditText) findViewById(R.id.editText1);
editText.setText(editText.getText().toString() + title);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!