【发布时间】:2019-02-09 05:17:23
【问题描述】:
相关:
Need suggestion about a mixed "Uri / int id" images ambient
现在我的问题是:
ImageView imgView=(ImageView)findViewById(R.id.imgView);
Uri imgUri=Uri.parse("android.resource://my.package.name/"+R.drawable.image);
imageView.setImageURI(imgUri);
不起作用。为什么?
我知道
imgView.setImageDrawable(Drawable.createFromStream(
getContentResolver().openInputStream(imgUri),
null));
工作。
但这并不能解决我的问题。因为如果图像来自资源或来自相机 ACTION_PICK 意图,我想使用 uri 独立设置图像......
欢迎提出任何建议。 谢谢你。 问候
【问题讨论】:
-
我不敢相信没有人有同样的问题......也没有解决方案......为什么这样的东西不起作用?为什么根本没有记录?
标签: android