我无法在图像视图中查看数据库中的图像
I cant view the images from data base in an image view
嗨,我将图像名称存储在数据库中,图像位于 drwable 文件夹中,我将图像名称检索到字符串数组 (imageArray[]) 列表中,以便在图像视图中查看它,我这样做了,但是它不工作
imageview1.setImageResource(Integer.parseInt("R.drawable."+imageArray[pos]);
有什么想法吗?
尝试使用此代码检索可绘制对象。
String imageId=imageArray[pos];
Drawable drawable = getResources().getDrawable(getResources()
.getIdentifier(imageId, "drawable", getPackageName()));
imageview1.setImageDrawable(drawable);
嗨,我将图像名称存储在数据库中,图像位于 drwable 文件夹中,我将图像名称检索到字符串数组 (imageArray[]) 列表中,以便在图像视图中查看它,我这样做了,但是它不工作
imageview1.setImageResource(Integer.parseInt("R.drawable."+imageArray[pos]);
有什么想法吗?
尝试使用此代码检索可绘制对象。
String imageId=imageArray[pos];
Drawable drawable = getResources().getDrawable(getResources()
.getIdentifier(imageId, "drawable", getPackageName()));
imageview1.setImageDrawable(drawable);