i have a listview with checkbox in each rows.
i’m using custom cursoradapter and a Array variable for saving checkbox status.
everything is fine.
now i’m trying to delete all checked rows.
but i have no idea how to deal with this.
i know which checkbox is checked. i can save the checked checkbox positions in a new array variable.
but i don’t know how to find the database _id by listview position(cursor.getPosition).
is there any way to find the DB _id by listview position(cursor.getPosition)?
or i hope i want to know if there’s another way to delete a listview row which is checked in checkbox.
relatvant link or any other comment will be appreciated.
thank you
You should be able to get the _id value for a row at a given position via the
CursorAdapter.getItemId(int position)method. See documentation here.