开发者

issue on sdcard in sdcard

i need to retrieve the images from sdcard,i used the following code.

String[] projection = {MediaStore.Images.Thumbnails._ID};
    cursor = managedQuery( MediaStore.Images.Thumbnails.EXTERNAL_CONTENT_URI,
            projection, 
            null,       
            null,
            MediaStore.Images.Thumbnails.IMAGE_ID);
    columnIndex = cursor.getColumnIndexOrThrow(MediaStore.Images.Thumbnails._ID);
    int s开发者_开发问答ize = cursor.getCount();

but the cursor always returns Zero.so i cann't get image from sdcard .whats the solution.


Do you add the permisson to your XML code?

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜