Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Build a Simple Android App (retired 2014) Getting Started with Android Adding an OnClickListener to a Button

Iskandar Fendi
Iskandar Fendi
5,700 Points

Can't understand 2;56 - 3:09, the word FINAL

  1. It said that our answer label variable can't be reassigned? You mean the answerLabel TextView DataType's value? Like we assigned "Yes" and it can't be assigned again.

  2. Then, for the rest can you explain it more further. It said OnClick method must refer to same view as long as it exist (In this case our view will be textview right?)

3.WE can't make it update a different text view by reassigning the answer label variable to some other text view So does it mean, we have: String answer = "Yes"

and let say I has two variable of TextView TextView answerLabel; Text View Answer Label2;

onClick(){ //It can't do String answer = "Yes" answerLabel.setText(answer) answerLabel2.setText(answer); }

Am I correct?