I am working on adding achievement to an app
. I have a global achievements controller that is in charge of updating and setting achievements to complete. I want to assign a bitmap to each achievement, that will be displayed when the achievement has been completed.
I am trying to do the follow in the AchievementController
:
bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.someImage);
Achievement.setBitmap(bitmap);
But the method getresources
will not work, because there is no context.
I cannot pass the context as a parameter to this class, because it is static.
So, I need some way to set bitmaps in a static class, without using a context