android - Make a edittext box display on a textview? -


i trying make android app local fence painting business , want calculate quotes , payments. problem figuring out how simple input box square feet of fence (edittext) of button display input textview. me?

also if there different way love hear it. thank you!

my problem figuring out how simple input box square feet of fence (edittext) of button display input textview.

pretty simple. create textview, button , edittext object:

textview txtview; button btn; edittext edttext; 

initialize them:

txtview = (textview) findviewbyid(r.id...); btn = (button) findviewbyid(r.id...); edttext = (edittext) findviewbyid(r.id...); 

this how input of edittext clicking button , set input textview:

btn.setonclicklistener(new view.onclicklistener() {      @override     public void onclick(view v) {          string inputtext = edttext.gettext().tostring(); // input          txtview.settext(inputtext); // set text textview     } }); 

Comments

Popular posts from this blog

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

Android Gson.fromJson error -