Please tell me how to work with resources, not from the Activity ? Found such a hint on this resource:
It is necessary to transfer a class to the class constructor, for example:
SomeClass someClass = new SomeClass(MainActivity.this); And in your class SomeClass:
public SomeClass { Context context; SomeClass(Context context) { this.context = context; } protected void someMethod() { ... ваш код String str = context.getResources().getString(R.string.tvBottomText); } } Those. not so easy:
getResources().getString(R.string.tvBottomText); but:
context.getResources().getString(R.string.tvBottomText); But honestly I did not understand. I would appreciate the code.