我正在努力展示来自画廊的图片下面是代码。在这里,我想在特定文件夹中打开图像,名称将在编辑文本中给出。请帮助我这样做,因为它目前打开所有与应用程序无关的图像并且我很难识别图像。
protected void LoadGalleryImages() {
final String[] columns = { MediaStore.Images.Media.DATA,
MediaStore.Images.Media._ID };
final String orderBy = MediaStore.Images.Media._ID;
imagecursor = managedQuery(
MediaStore.Images.Media.EXTERNAL_CONTENT_URI, columns, null,
null, orderBy);
int image_column_index = 0;
if (imagecursor != null) {
image_column_index = imagecursor
.getColumnIndex(MediaStore.Images.Media._ID);
count = imagecursor.getCount();
}
imgSelected = new String[count];
arrPath = new String[count];
thumbnailsselection = new boolean[count];
for (int i = 0; i < count; i++) {
if (imagecursor != null) {
imagecursor.moveToPosition(i);
// int id = imagecursor.getInt(image_column_index);
int dataColumnIndex = imagecursor
.getColumnIndex(MediaStore.Images.Media.DATA);
arrPath[i] = imagecursor.getString(dataColumnIndex);
}
}
}