Can't display image formatted png on Android -


today encounter strange question. have png image "image.png", generatied java code, , anthor image "a.png". import them /sdcard/image/ directory. when invoke code

bitmap bit = bitmapfactory.decodefile("/sdcard/image/image.png"); 

and

bit = bitmapfactory.decodefile("/sdcard/image/a.png"); 

on android, first bit null latter not. sure path "/sdcard/image" right.

could me???

you can path of sdcard code:

file extstore = environment.getexternalstoragedirectory(); 

then specify foldername , file name

"/image/"+"image.jpg"   bit = bitmapfactory.decodefile(extstore +"/image/a.jpg"); 

Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -