2011-02-11 3 views
0

mediastore를 사용하여 sdcard의 이미지를 쿼리하는 데 managedQuery를 사용하고 있지만 getColumnIndexOrThrow 함수를 통해 얻을 수없고 에뮬레이터에서 오류 대화 상자가 표시되지 않습니다.Android 커서 getColumnIndexOrThrow가 오류를 발생했습니다.

image_cursor = this.managedQuery (MediaStore.Images.Media.EXTERNAL_CONTENT_URI, null, null, null, null);

if (image_cursor == null) 
    { 
     TextView test = (TextView) this.findViewById(R.id.textView1); 
     test.setText("null"); 
    } 
    while (image_cursor.moveToNext()) { 
     if (image_cursor.getCount() > 0) 
     { 
      TextView test = (TextView) this.findViewById(R.id.textView1); 
      test.setText("entered"); 
     int index = image_cursor.getColumnIndexOrThrow(MediaStore.Images.Media.CONTENT_TYPE); 

     // TextView test = (TextView) this.findViewById(R.id.textView1); 

     // test.setText(image_cursor.getString(index)); 
     } 
    } 
} 

누구나 전에이 문제가 있습니까?

답변

관련 문제