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 trialFlorin Vasilescu
Courses Plus Student 1,659 PointsButton Text?
I don't understand what text for the button I should add or change.I don't understand
3 Answers
Tom Spencer
7,713 PointsI haven't gotten this far in the android track yet just about to finish publishing the fun facts app. I believe all you have to do is remove "SAVE" from the last line and just put the variable label in its place.
String[] phoneNumberLabels = { "-home", "-work", "-mobile" };
Button saveButton = (Button) findViewById(R.id.saveButton);
String label = getString(R.string.saveLabel);
saveButton.setText("SAVE");
Florin Vasilescu
Courses Plus Student 1,659 PointsYes that was it.Thank you! The initial text of the Button was "Save" and now it's Save My Changes so the request was confusing for me.
Tom Spencer
7,713 PointsYou're welcome. It was confusing for me as well, most likely won't be the last time I'll be confused either. Glad I could help you out. Good luck with the rest of the course.
Florin Vasilescu
Courses Plus Student 1,659 PointsNone it's a challenge on Android build a blog!
Gloria Dwomoh
13,116 PointsOh okay. Can you paste the question here and what you have done so far or the code they have provided on it?
Florin Vasilescu
Courses Plus Student 1,659 PointsSet the text of the Button using the 'label' variable instead of the hard-coded text currently there. This is the StringTest.java String[] phoneNumberLabels = { "-home", "-work", "-mobile" };
Button saveButton = (Button) findViewById(R.id.saveButton); String label = getString(R.string.saveLabel); saveButton.setText("SAVE");
this is the xml <?xml version="1.0" encoding="utf-8"?> <resources> <string name="saveLabel">Save My Changes</string> </resources>
Gloria Dwomoh
13,116 PointsCan you please markdown your code. It shows how to it here, there is an animation titled "Screencast of posting code:" that shows how to markdown code.
Gloria Dwomoh
13,116 PointsGloria Dwomoh
13,116 PointsAre you using Android studio or Eclipse?