Reputation: 476
I pass the image from drawable reference like follows
Bitmap bitmap = mImageGenerator.generateDateImage(calendar, R.drawable.data);
it throws
java.lang.IllegalStateException: Immutable bitmap passed to Canvas constructor
I use same exact statement in other activity and it works fine.
Problem :
mImageGenerator.generateDateImage is locked class from caldroid (https://github.com/roomorama/Caldroid)
so cant change anything in it.
I just noticed that this occurs on NOUGAT How do I solve this issue?
Upvotes: 2
Views: 4797
Reputation: 476
So the solution is to add
BitmapFactory.Options options = new BitmapFactory.Options();
options.inScaled = false;
options.inMutable = true;<<<<<<
in custom created class ownImageGenerator
Upvotes: 1