android - How do I set the value of a TextView to user input of EditText -


here have

  protected void oncreate(bundle savedinstancestate) {     super.oncreate(savedinstancestate);     setcontentview(r.layout.activity_main);     edittext edittext = (edittext)findviewbyid(r.id.subject1);     textview textview = (textview)findviewbyid(r.id.testtext);     string value = edittext.gettext().tostring();     textview.settext(value);  } 

for reason not work? makes textview blank

oncreate when activity starts. sure when happens, haven't typed it. need textwatcher if want countinouly this.


Comments