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

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -