android - Get the filename that your ImageView loaded it's image from -
i looking built in method of imageview object tell me file retrieved image from.
for example earlier in code called...
imageview iv = new imageview(mainactivity.this); iv.setimagebitmap(bitmapfactory.decodefile(f.getabsolutepath()));
assume no longer have reference 'f' , need find out f was. there way that? work around creating class extends imageview , has string pared it. (or create map between imageview , string)
recommendations?
the easiest workaround using tag imageview:
imageview iv = new imageview(mainactivity.this); string path = f.getabsolutepath(); iv.setimagebitmap(bitmapfactory.decodefile(path)); iv.settag(path);
retrieving path:
string path = (string) iv.gettag();
Comments
Post a Comment