TextView defined in main.xml - how to "name" it to be able to use - setText() method?

Posted by Oliver Goossens on Stack Overflow See other posts from Stack Overflow or by Oliver Goossens
Published on 2010-05-18T22:18:26Z Indexed on 2010/05/18 22:20 UTC
Read the original article Hit count: 450

Filed under:
|
|
|

Hi,

I am exploring android and developement and I found one problem.

My app UI is defined in main.xml

I have 2 texts and 2 buttons defined - easy app.

I read that I may be able to change TEXT in the ACTIVITY using the setText() method.

And thats the problem - how do I POINT the setText() Method? How do I tell it to change a specified text?

If I would declare the TextView inside the Activity with NEW TextView NAME Object, I would just need to use NAME.setText(STRING)... But I didnt so i dont have anything like NAME of the object?

How can this be done? I read something about r.IDs but I truly dont have a idea how to use them, where to find them and how to implement it ....

Please advise

Thank you

Oliver

© Stack Overflow or respective owner

Related posts about android

Related posts about textview