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

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -

java - Digest auth with Spring Security using javaconfig -