Your class currently has a default constructor, MyDrawable (), which calls BitmapDrawable (), which is deprecated!
Add a constructor with two arguments (resources and bitmaps) to your class and call the super constructor:
BitmapDrawable(context.getResources(), canvasBitmap);
this should solve your problem.
source
share