Answer the question
In order to leave comments, you need to log in
Strings for everything?
Your application must use keys for SharedPreference in both XML files and code.
Up to this point, I kept the keys in strings.xml, working with them like this.
But now there is a need to store these keys also as public final static String in the class, for convenience, but in order to get them we need a Context to access resources from it.
Do I understand correctly that there is no convenient way to combine strings in xml and code, and you either need to store two instances (one in strings.xml, the other in code), or be sure to initialize them through Context?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question