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!
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
Elliott Leinauer
Courses Plus Student 129 PointsCant seem to get getAnswerButton = (Button) findButtonById(R.id.Button1); question right
Im doing the quiz and im supposed to get this answer correct all it says is Button getAnswerButton; and then a added the rest on, is there anything your seeing that im doing wrong because it keeps on saying im doing somthing wrong on that string and i cant figure out what!!
2 Answers

Stone Preston
42,016 Pointsok your initial answer is almost correct:
you had:
Button getAnswerButton = (Button) findButtonById(R.id.Button1);
the problems with the above code is you used the wrong method (there is no findButtonById method). you nee to use findViewById. the ID is also button1, not Button1. capitalization matters.
Button getAnswerButton = (Button) findViewById(R.id.button1);

Elliott Leinauer
Courses Plus Student 129 Points
Stone Preston
42,016 Pointssee my answer below. you made a few small errors.
Stone Preston
42,016 PointsStone Preston
42,016 Pointscan you post a link to the challenge/quiz you are stuck on.