Can I get the src URI from an Imageview?

纵饮孤独 提交于 2019-12-12 06:27:23

问题


is it possible to get the src Value of an ImageView as URI?

Help would be great


回答1:


No. By the time the ImageView has the image, the source of that image is long gone.




回答2:


If you know what image it is in your drawable, you can do something like this.

String path = Uri.parse("android.resource://my.package.name/" + R.drawable.myimage).toString();

More info - https://stackoverflow.com/a/28505621/2197529



来源:https://stackoverflow.com/questions/37013437/can-i-get-the-src-uri-from-an-imageview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!