开发者

How to display data in TextView

开发者 https://www.devze.com 2023-01-03 16:20 出处:网络
I 开发者_开发知识库have a view in which there is a text box where user enters data, when clicks on submit, I want to store the input and display in another box.

I 开发者_开发知识库have a view in which there is a text box where user enters data, when clicks on submit, I want to store the input and display in another box.

final EditText edittext = (EditText) findViewById(R.id.edittext);
mText = (TextView) findViewById(R.id.timepicker_input);

How can I do it, please help


final EditText edittext = (EditText) findViewById(R.id.edittext); 
TextView mText = (TextView) findViewById(R.id.timepicker_input);
mText.setText(edittext.getText().toString());


String info = edittext.getText().toString();
mText.setText(info);


final EditText edittext = (EditText) findViewById(R.id.edittext);
TextView mText = (TextView) findViewById(R.id.timepicker_input);
String storedData = edittext.getText().toString();
mText.setText(storedData);

Here, you can use the string storedData in another activity or to setText for another editText (textbox)

0

精彩评论

暂无评论...
验证码 换一张
取 消