display file class:
I'm developing a TODO list app and I was able to add items to the listview with checkbox but I'm having trouble deleting checked items when clicking on the delete button. Here is my sample code for reference.
private void displayData() {
db = mHelper.getWritableDatabase();
Cursor mCursor = db.rawQuery("SELECT * FROM " + DataBase.TABLE_NAME, null);
userId.clear();
user_emType.clear();
if (mCursor.moveToFirst()) {
do {
userId.add(mCursor.getString(mCursor.getColumnIndex(DataBase.KEY_ID)));
user_emType.add(mCursor.getString(mCursor.getColumnIndex(DataBase.KEY_FNAME)));
}
while (mCursor.moveToNext());
}
DisplayAdapter disadpt = new DisplayAdapter(DisplayFile.this, userId, user_emType);
userList.setAdapter(disadpt);
mCursor.close();
}
i want to delete checked items from the database...
0 comments:
Post a Comment