2011-02-11 7 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)); 
     } 
    } 
} 

誰でもこの問題が発生していますか?

答えて

関連する問題