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
Stacia Lowery
5,868 PointsIs it not possible to simply change the string value in strings.xml at runtime?
This seems like a very roundabout way of doing this. Basically we create a string (in my case labeled "player_name") which holds the value "name." Then we use "name" as the key for putting data in the intent by using R.string.player_name.
Why can't we change the value of the string from "name" to our desired player_name, and then use getString() when we want to access it?
1 Answer
Stacia Lowery
5,868 PointsNevermind, some googling tells me that this is not possible to do, because resources can't be modified at runtime.