Currently I am working on a project with Particle which works fine with colour constants, but I want to use drawable/bitmap instead.
DATA = new int[]{16777215, -2130706433, 16777215};
and than passing onto create bitmap with DATA
.
BMP = Bitmap.createBitmap(DATA, 0, 5, 1, 1, Bitmap.Config.ARGB_8888);
How should I use drawable resource and pass it on to create bitmap?
I have already tried context.getResources()
and also have tried with a class
public class App extends Application {
private static Context mContext;
@Override
public void onCreate() {
super.onCreate();
mContext = this;
}
public static Context getContext() {
return mContext;
}
}
And use App.getContext().getResources()
, but it's not working. I am trying to create Bitmap in abstract static class.