Android Build an Interactive Story App Intents and Multiple Activities Using String Resources

"Bummer! Don't forget to call getString() to get the string value from strings.xml"

Hello! I got "Bummer! Don't forget to call getString() to get the string value from strings.xml" message but I can't find errors in the code: Resources resources = getResources(); String buttonLabel = resources.getString(R.string.morePuppies); Could you help me to find out what's wrong? Thanks in advance!

CodeChallenge.java
Button loadPuppiesButton = (Button) findViewById(R.id.puppiesButton);
Resources resources = getResources();
String buttonLabel = resources.getString(R.string.morePuppies);
loadPuppiesButton.setText("LOAD");
strings.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="morePuppies">See More Puppies</string>
</resources>

1 Answer

I solved this problem: Button loadPuppiesButton = (Button) findViewById(R.id.puppiesButton); String buttonLabel = getString(R.string.morePuppies); loadPuppiesButton.setText("LOAD");

But I didn't understand why I couldn't use Resources method.