В настоящее время я использую managedQuery для запроса изображений в sdcard с помощью mediastore, но не смог пройти через функцию 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));
}
}
}
Кто-нибудь сталкивался с этой проблемой раньше?