Hello, I have some coordinates to show them as markers in map, plus, i want to display an AlertDialog descritpion when i tap on each marker, 3 of 4 markers well shows an AlertDialog but no the correct description, the 4th force closes the application with this logcat error:
08-24 12:28:35.942: ERROR/AndroidRuntime(241): android.database.CursorIndexOutOfBoundsException: Index 4 requested, with a size of 4 Abd here is the code: @Override protected boolean onTap(int index) { 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); cur.moveToPosition(index); 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(); cur.close(); db.close(); return true; } Any idea please of the source of the problem? I really don't know how to solve it. Thank you for your help. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en