android - Universal Image Loader and BitmapDrawable -


we have image in b64, want use image loading image in universal image loader while better image isn't loaded url. create bitmap url in b64 , convert bitmapdrawable. result shown fine if do:

imageview.setimagedrawable(bitmapdrawable) 

but, on displayimageoptions, if set bitmapdrawable image on loading, image never shown. i'm doing following:

final displayimageoptions imageoptions = mdisplayimageoptionsdefaultbuilder.         .showimageonloading(bitmapdrawable)         .showimageonfail(bitmapdrawable)         .showimageforemptyuri(bitmapdrawable)         .build() 

as can see, setting bitmap drawable not image when loading, image when fails (as don't want image change in case of error while loading better image url). result of bitmap drawable never shown. doing wrong?

update: after debugging happening i've seen problem not bitmap drawable, supported , working fine. problem using default display options builder (mdisplayimageoptionsdefaultbuilder), @ point did:

final displayimageoptions imageoptions = mdisplayimageoptionsdefaultbuilder.         .showimageonloading(loadingresource)         .showimageonfail(errorresource)         .showimageforemptyuri(errorresource)         .build() 

so there's bug in universal image loader, because i'm creating display image options with:

.showimageonloading(bitmapdrawable) 

another "solution" do:

final displayimageoptions imageoptions = mdisplayimageoptionsdefaultbuilder.         .showimageonloading(0)         .showimageonloading(loadingresource)         .showimageonfail(errorresource)         .showimageforemptyuri(errorresource)         .build() 

but internally stores there's resource stored, drawable not shown stored resource instead. creating new displayimageoptionsbuilder worked me, nice if showimageonloading set drawable, old resource automatically cleared.

thanks in advance.

uil supports following schemes:

"h t t p://site.com/image.png" // web "file:///mnt/sdcard/image.png" // sd card "file:///mnt/sdcard/video.mp4" // sd card (video thumbnail) "content://media/external/images/media/13" // content provider "content://media/external/video/media/13" // content provider (video thumbnail) "assets://image.png" // assets "drawable://" + r.drawable.img // drawables (non-9patch images) 

use these schemes.


Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -