У меня есть этот код для отображения AlertDialog при прикосновении к маркеру:
public void showOverlay (OverlayItem overlay)
{
db = openHelper.getWritableDatabase();
String[] columns_descri = new String[] {COL_DESCRI};
Cursor cur = db.query(true, TABLE_COORD, columns_descri,null, null, null, null, null, null);
String description = cur.getString(cur.getColumnIndexOrThrow(COL_DESCRI));
AlertDialog.Builder dialog = new AlertDialog.Builder(Geo.this);
dialog.setTitle("Infos.");
dialog.setMessage(description);
dialog.setPositiveButton("OK", new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
dialog.show();
db.close();
}
@Override
public boolean onTap(int index)
{
showOverlay(getItem(index)) ;
return super.onTap(index) ;
}
Странно, что у меня есть FC с ошибкой logcat:
08-24 20:51:42.466: ERROR/AndroidRuntime(265): Uncaught handler: thread main exiting due to uncaught exception
08-24 20:51:42.486: ERROR/AndroidRuntime(265): android.database.CursorIndexOutOfBoundsException: Index -1 requested, with a size of 4
Есть идеи, пожалуйста?
Спасибо.