ImageView image = ((ImageView) arg1.findViewById(R.id.imageView1));
如何以编程方式获取该图像的路径/资源?谢谢。
PS:我知道我可以这样设置:
image.setImageResource(resource)
最佳答案
很难说你能得到它的路径,但是你可以通过这种方式得到它的URI:
Uri fileUri = Uri.parse("android.resource://your_packagename/" + R.drawable.your_image_id);
关于安卓 : Programatically get the path/resource of an image in an ImageView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17568437/