getString Outside of a Context or Activity

Yes, we can access resources without using `Context`

You can use:

Resources.getSystem().getString(android.R.string.somecommonstuff)

… everywhere in your application, even in static constants declarations.
Unfortunately, it supports the system resources only.

For local resources use this solution. It is not trivial, but it works.

Leave a Comment