there's not necessarily a path for an image. it's better to say the source of the image, be it a file, an HTTP stream, or otherwise. and unfortunately, that info is lost once it's set into an ImageView
.
to set the image bits into an ImageView
, you construct a Bitmap
, usually using one of the decode*()
methods in BitmapFactory
. that is what determines the source of the image. in your unit test framework, you can get a handle to the ImageView
by getting the Activity
and calling findViewById()
, but that's not going to help you.
there may be other places for you to hook into the code to determine that sources for the image data, but i can't say without knowing your application source code.
you could ask your developers to make the source available in the ImageView
's tag (see setTag()
/ getTag()
). that way you could pull it out in your unit tests. of course, you'll have to have an understanding with them as to what the source will be (a URL, a database URI, a file path, ?).