There are similar questions on SO, but none worked for me.
I want to fetch clicked image in Activity1 and display it in Activity2.
I'm fetching image id of clicked image like this:
((ImageView) v).getId()
and passing it through intent to another activity.
In 2nd activity, I use image id as following:
imageView.setImageResource(imgId);
I logged the value og image id in both the activities and it's same.
But I'm getting following exception:
android.content.res.Resources$NotFoundException: Resource is not a Drawable
(color or path): TypedValue{t=0x12/d=0x0 a=2 r=0x7f050000}
I guess the problem here is getId()
is returning Id of ImageView
and not of it's source image.
All these images are present in drawable
.
Any help appreciated.