i want to create a CloseableReference
the method .of have two implements, if i use the first one
private PlatformBitmapFactory bmpFactory = new PlatformBitmapFactory() {
@Override
public CloseableReference<Bitmap> createBitmap(int width, int height, Bitmap.Config bitmapConfig) {
CloseableReference<Bitmap> cr = CloseableReference
.of(Bitmap.createBitmap(width, height, bitmapConfig));
return cr;
}
};
it would be a compile error:
of(java.io.CloseableReference & android.graphics.Bitmap) in CloseableReference cannot be applied to (android.graphics.Bitmap)
But if i use the second one, i dont know how to make a ResourceReleaser .(actually its a interface , a super class of CloseableReference)
how should i put parameter in .of method?(and what the '&' mean in parameter?)
Taking a step back, why would you want to implement PlatformBitmapFactory? You should really just be using one of the provided implementations.
It looks like you imported the wrong CloseableReference - you are using java.io.CloseableReference, not the Fresco one.
but the PlatformBitmapFactory do not have a subclass in API...?i want to create the abstract class so i need to implement that method.e e.
i make sure again, there is no java.io.CloseableReference, its a IDE mistake maybe.
i know Bitmap is not a closeable so that i need put SimpleBitmapReleaser.getInstance()when create refer object.Thanks anyway.
BUT a new question comes, i cant put non-closeable to cache.
Fresco.getImagePipelineFactory().getBitmapMemoryCache().cache(key, bmpFactory.createBitmap(width, height, config)));
(even i dont know what work it do)