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 Blog Reader Android App Rebuilding from Scratch All About @string Resources

Button Text?

I don't understand what text for the button I should add or change.I don't understand

Are you using Android studio or Eclipse?

3 Answers

Tom Spencer
Tom Spencer
7,713 Points

I 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");

Yes 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
Tom Spencer
7,713 Points

You'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.

None it's a challenge on Android build a blog!

Oh okay. Can you paste the question here and what you have done so far or the code they have provided on it?

Set 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>

Can 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.