我需要仅使用文件名来显示图像,而不是使用资源ID.
ImageView imgView = new ImageView(this); imgView.setBackgroundResource(R.drawable.img1);
我在drawable文件夹中有图像img1.我希望从文件中显示该图像.
我怎样才能做到这一点?
android imageview android-imageview android-file
android ×1
android-file ×1
android-imageview ×1
imageview ×1