I trying to set the title for my viewpager, I can\'t seem to get it to work. I tried Resources.getSystem().getString(R.string.title1); and also tried to pass a context. Coul
Well, according to your error message you do not have a String with the ID you are requesting.
Could it be that you are supporting multi languages and only have this kind of String-ID for a specific language?
Anyways, this line of code:
String yourstring = getResources().getString(R.string.yourstring);
is how to get a String from Resources. getResources()
can be called whenever you are in a class extending Context
, such as Activity
.