I have a few strings which have been put in the android values/strings.xml file in my android project.
<resources>
<string name="level_reached_label">Level Reached: </string>
<string name="endgame_textP1">You have scored </string>
<string name="endgame_textP2"> points in </string>
<string name="endgame_textP3"> seconds </string>
</resources>
I call the strings with this line in one of my java classes
endLevelLabel.setText(R.string.level_reached_label + level);
endInfoLabel.setText(R.string.endgame_textP1 + score + R.string.endgame_textP2 + gameTime + R.string.endgame_textP3);
The first line runs fine but the second line gives this error (the program works with the 2nd line commented out):
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.web.mathtaketwo/com.web.mathtaketwo.EndGame}: android.content.res.Resources$NotFoundException: String resource ID #0x7d1500be
What did i do wrong that stopped this string from working? Is it because i am trying to use multiple strings in 1 line combined with variables? Why does the other string load fine?
note: the two object that are being set are TextView
's:
TextView endInfoLabel = (TextView)findViewById(R.id.endInfoLabel);
TextView endLevelLabel = (TextView)findViewById(R.id.endLevelLabel);