getResources() lit red, the class is not inherited from any class.

    1 answer 1

    The abstract Resources getResources() method is defined in the Context abstract class, therefore, this method can be called on a class object, in the inheritance hierarchy of which there is a Context class ( Activity , Service , etc.).

    But inheriting a class from Context and others like it to gain access to the getResources() method is a very strange idea.

    You can call the getResources() method from any place, for example, using the Application class.