java - find local path to getUnlockedImageUri -


i able show achievement images using imagemanager uri method getunlockedimageuri reasons, need find local path image because don't want use imageview , need actual file path image

the uri of google play games achievement looks content://com.google.android.gms.games.background/images/d2bbfba4/61 , hoping able convert file object below:

file myfile = new file(ach.getunlockedimageuri().getpath()); log.i(exconsts.tag, "myfile.exists() = " + myfile.exists()); // returns false! 

but not work! idea why? or else should try? or tell me if it's possible?

a content:// uri clear sign either

  • there no local file
  • you not have direct access local file

as stated in getrevealedimageuri() javadoc:

to retrieve image uri, use imagemanager.

you can use imageloader.loadimage(onimageloadedlistener, uri) drawable can drawn onto canvas using drawable.draw(canvas).

you can convert drawable bitmap using similar this answer if you'd like.


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

python - pip wont install .WHL files -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -