January 21st, 2012, 06:31 PM
|
#1 (permalink)
|
|
New Member
Join Date: Nov 2010
Posts: 1
Device(s):
Thanks: 0
Thanked 0 Times in 0 Posts
|
How to get the URI of a Drawable in code
Hello,
I am working on an Android application where I deliver some built-in images and give the user the option to download some more from the web to use in the application. At some point in my app, I look at an ImageView in my layout and want to determine if the Drawable inside is an in-built resource or an image I have downloaded from the web to the SD Card.
Is there any way to extract the URI of the Drawable used in the ImageView? This way I would be able to see if it is a resource or a downloaded file.
Here is my code so far:
Code:
ImageView view = (ImageView) layout.findViewById(R.id.content_img);
Drawable image = view.getDrawable();
Any help will be greatly appreciated!
|
|
|