Android 用游标中的数据填充int数组?

Android 用游标中的数据填充int数组?,android,arrays,sqlite,cursor,gallery,Android,Arrays,Sqlite,Cursor,Gallery,我试图从sqlite数据库的游标填充int数组。我想用一些照片设置图库视图,但我的代码不起作用: String uri = cursor.getString(cursor.getColumnIndex(HipotecaDbAdapter.C_COLUMNA_FOTO1)); int Idfoto = this.getResources().getIdentifier(uri,null,this.getPackageName()); imgsimple.se

我试图从sqlite数据库的游标填充int数组。我想用一些照片设置图库视图,但我的代码不起作用:

String uri = cursor.getString(cursor.getColumnIndex(HipotecaDbAdapter.C_COLUMNA_FOTO1));
          int Idfoto = this.getResources().getIdentifier(uri,null,this.getPackageName());

         imgsimple.setImageResource(Idfoto);
C_COLUMNA_FOTO1有一个字符串:“R.drawable.FOTO1,R.drawable.foto2”


有什么想法吗?

请随意解释什么不起作用对您意味着什么。@user3136374您的实际问题是什么?我有一个来自sqlite数据库的光标,其中包含保存在res/drawables中的图像路径。我想在gallery或imageswitcher中显示这些照片,但我不知道如何从cursor中获取这些数据并填充我的gallery的必要数组。它可以处理一张照片,但不能处理更多。。。。