could any one help me that how to perform long click option in list view item's so i able to delete my notes from sq lite database ...i have 2 column in my note app they are id ,title and notetext
my code to create table is ..
mydb1 = Main1Activity.this.openOrCreateDatabase("185", MODE_PRIVATE, null);
mydb1.execSQL("CREATE TABLE IF NOT EXISTS notes (id INTEGER PRIMARY KEY AUTOINCREMENT,title varchar,notetext varchar);");
long click code
lv.setOnItemLongClickListener(new OnItemLongClickListener(){
public boolean onItemLongClick(AdapterView<?> arg0, View arg1, int arg2,long arg3) {
data.remove(arg2);
// adapter.notifyDataSetChanged();
//adapter.notifyDataSetInvalidated();
return true;
}
});