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
If you are trying to access string resources from outside of an activity, then you need to pass the context in to that class (which you stated you have already done), and then call
String str = context.getResources().getString(R.string.some_string);
Also check your strings.xml
file to make sure that you are using the string id correctly.
If you're using android studio you should be able to simply start typing R.string.
and it will then show suggestions from the strings.xml file. If you do not see your resource here, then that may indicate a problem with the way you are storing your resources, as opposed to how you are trying to access them.