java - setText() from not layout xml -
is possible settext() 1 class another, let me explain, example class a have layout a.xml , class b have b.xml.
is possible settext() textview in b.xml class a?
i tryed doing this:
setcontentview(r.layout.activity_match_finder); hold = (textview) findviewbyid(r.id.hold); hold.settext(""); but didn't work.
you can send text via intent 1 class , set textview so:
class a:
string word = "hello"; intent send= new intent(a.this,b.class); send.putextra("tag", word); a.this.startactivity(send); then in class b
string getval; getval = getintent().getextras().getstring("tag"); textview.settext(getval); obviously intent in class needs sent using sort of button click depending on design wants.
Comments
Post a Comment