android - How to extract String resource in my code? -
when add string parameter this, ok:
mpages[0] = new page( r.drawable.page0, "on return trip studying saturn's rings, hear distress signal seems coming" + " surface of mars. it's strange because there hasn't been colony there in years. " + "even stranger, it's calling name: \"help me, %1$s, you're hope.\"", new choice("stop , investigate", 1), new choice("continue home earth", 2));
however, when try extract string resource this, there error
mpages[0] = new page( r.drawable.page0, .getstring(r.string.story_page0), new choice("stop , investigate", 1), new choice("continue home earth", 2));
so should do?
try use :
mpages[0] = new page( r.drawable.page0, string.valueof(r.string.story_page0), new choice("stop , investigate", 1), new choice("continue home earth", 2));
and advice make strings "stop , investigate" , "continue home earth" in string.xml
file
Comments
Post a Comment