Uri imge = Images.Media.INTERNAL_CONTENT_URI;
 
  ContentResolver  cr=getContentResolver();
   
    final String[] clo = new String[]{ 
      
     Images.ImageColumns.BUCKET_ID  
 
    };
           
   Cursor cursor =cr.query(imge, clo, null,null, null);
    
     while (cursor.moveToNext())
     {
                无法获取!! 没有值 返回0     Log.d("a", cursor.getString(0) );
     }
    cursor.close();
   

解决方案 »

  1.   

    Cursor cur = getContentResolver().query(
    android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
    null, null, null, null);
    while (cur.moveToNext()) {
    String name = cur.getString(cur.getColumnIndexOrThrow(Images.Media.TITLE));
    Log.v("=========================",name);
    }
    cur.close();前提是得有图片。否则,代码是对的,也没有结果。
      

  2.   


    看清题目!!!
    我用的INTERNAL_CONTENT_URI不是EXTERNAL_CONTENT_URI(sd中的)!!!
      

  3.   

    if(cursor != null && cursor.moveToFirst()){
           if(cursor.getCount() > 0){
                  do{
    Log.d();
          } while (cursor.moveToNext() 
           }else{
                  ;
           }
    }