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

Popular posts from this blog

node.js - Using Node without global install -

How to access a php class file from PHPFox framework into javascript code written in simple HTML file? -

java - Null response to php query in android, even though php works properly -