I have no idea how to get an Image URL from already settled ImageView. Actually, I have an ImageView over which picture is set from a URL. Now I have a button on that button_clik I have to fetch that ImageView URL. Is it possible or not ? Thanks in advance.
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How can I create this custom Bottom Navigation on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
u cannot get the image url from the imageview...infact u will have to use the alternate. For example u might be saving the urls for the imageview in some array...u need to get the position of the imageview clicked and using that position u can get the url of the clicked image...if u r using listview/gridview it is very easy to get the position but if not, u can set the pos as tag of image and retrieve the tag that will specify the position.
if u need help feel free to ask...
I think you can't get URL from ImageView. What you can do is you can store the URL in variable or SharedPreference when you are setting image in ImageView so next time when you want to fetch URL you can directly get it from variable or SharedPreference.
By Using Picasso Lib Picasso.with(contxt).load(imageurl).placeholder(R.drawable.ic_launcher).into(imageview);