I have the following code that will rotate a drawable by a set amount of degrees.
public Drawable rotateDrawable(float angle, Context context)
{
Try this Once.
In Activity
BitmapDrawable background = new BitmapDrawable(this.getResources(), blurImageBg);
In Fragment
BitmapDrawable background = new BitmapDrawable(getActivity(), blurImageBg);
In Adapter or else
BitmapDrawable background = new BitmapDrawable(context.getResources(), blurImageBg);
Do this instead:
return new BitmapDrawable(context.getResources(), canvasBitmap);
Kotlin code for BitmapDrawable
:
var bitmapDrawable = BitmapDrawable(resources,bitmapObj)