I'm defining a class that sets a Drawable attribute in an object. The problem is that I can't access the getResource().getDrawable(int resourceId)
method unless I have some Context
.
What I did was to send to that class an activity instance (let's call it "act") and then I did:
act.getResources().getDrawable(R.drawable.whellchair)
but, when executing that line it throws a NullPointerException
.
When idea how to accomplish this?