如何获取EditText值并通过TextView在屏幕上显示它? [英] How to get EditText value and display it on screen through TextView?

查看:252
本文介绍了如何获取EditText值并通过TextView在屏幕上显示它?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想获得EditText视图的用户输入,并在单击Button时通过TextView在屏幕上显示它.我也想知道可以对string.xml文件进行哪些修改.

I want to get the user input for the EditText view and display it on the screen through TextView when the Button is clicked. I also, want to know what modifications can be done on the string.xml file to do this.

推荐答案

我没有得到第二个问题,也许您可​​以详细说明...但是对于您的第一个查询.

I didn't get the second question, maybe you can elaborate...but for your first query.

String content = edtEditText.getText().toString(); //gets you the contents of edit text
tvTextView.setText(content); //displays it in a textview..

这篇关于如何获取EditText值并通过TextView在屏幕上显示它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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