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 an Interactive Story App (Retired) Intents and Multiple Activities Using String Resources

Vidit Shah
Vidit Shah
6,037 Points

int to String conversion error .LAst Tast Build an INterface Help

Button loadPuppiesButton = (Button) findViewById(R.id.puppiesButton);
String buttonLabel = R.string.morePuppies;
<?xml version="1.0" encoding="utf-8"?>
  <string name="morePuppies">See More Puppies</string>


2 Answers

Judging by your code and the lack of a question, I assume you're stuck on task 2. In order to access the string you created in task 1 you need to call getString:

String buttonLabel = getString(R.string.morePuppies);

A side note - When you use the "Get Help" button while you're on a certain challenge(doesn't include videos), the website is smart enough to post your code. I fixed that for you. Please make sure to look at this post to see how to post your code properly or use the Markdown Cheatsheet that you can access under every comment you write.

final task is simple as that : change the ---> "LOAD" to just---> buttonLabel

Button loadPuppiesButton = (Button) findViewById(R.id.puppiesButton);
String buttonLabel = getString(R.string.morePuppies);