在我的應用我想從僅在Gridview.I Camera文件夾顯示圖像寫了下面的代碼導入圖像: -導入圖像
String[] projection = { MediaStore.Images.Thumbnails._ID, };
Cursor mImageCursor = getContentResolver().query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, projection, null, null, null);
if (mImageCursor != null)
{
mImageCursor.moveToFirst();
for (int i = 0; i < mImageCursor.getCount(); i++)
{
Images im=new Images();
int imageId = mImageCursor.getInt((mImageCursor.getColumnIndex(MediaStore.Images.Media._ID)));
Bitmap bm = MediaStore.Images.Thumbnails.getThumbnail(getContentResolver(),
imageId, MediaStore.Images.Thumbnails.MINI_KIND, null);
im.setBitmap(bm);
arrayOfImages.add(im);
mImageCursor.moveToNext();
}
}
但這代碼全部進口來自畫廊的圖像。 但我想從相機文件夾導入圖像。 p
**此博客可以幫助你。** http://startandroiddevelopment.blogspot.in/2013/10/importing-image-from-gallery.html – 2013-11-01 11:28:11