android - Is it possible to get the image path of an image in an image view? -


i have set image in image view. want save state , need know image path of image. there way that?

update:

// decode, scale , set image.             bitmap mybitmap = bitmapfactory.decodefile(selectedimagepath);             bitmap scaledbitmap = bitmap.createscaledbitmap(mybitmap, new_width, new_height, true);             mybitmap.recycle();             mybitmap = null;              mimageview.setimagebitmap(scaledbitmap); 

not directly, once image set on imageview turned drawable , else forgotten. however, use tags purpose. view can have tag associated represents metadata view. like:

imageview iv; //declared elsewhere uri imagepath = uri.parse("..."); //set image iv.setimageuri(imagepath); //add path value tag iv.settag(imagepath);   //sometime in future, retrieve uri path = (uri)iv.gettag(); 

you might consider creating subclass of imageview encapsulate function make code little easier read , maintain.

hth


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -