I'm using bitmap in a fragment, and I call bitmap.recycle()
in the onDestroy()
method of the fragment. But quite a few times I get an exception
E/AndroidRuntime(4869): java.lang.RuntimeException: Canvas: trying to use a recycled bitmap android.graphics.Bitmap@40659750
I also tried doing this in the onDestroyView()
method of the fragment but still got the same exception.
Can anyone suggest what is the best stage of the fragment life-cycle where I should call bitmap.recycle()