我希望在用户点击listview中的项目时通过设置onclicklistener来更新表格这里是我的代码
view_list.setOnItemClickListener(new OnItemClickListener()
{
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,long arg3)
{
String click = (addArrrayList.get(arg2).toString());
shoppingListDB.rawQuery("UPDATE ITEMS SET FOUND = 'YES' WHERE ITEM_NAME ="+ "'" +click+"'", null);
}
});
答案 0 :(得分:0)
现在正在使用,我已将rawQuery
更改为execSQL
String update = "UPDATE ITEMS SET FOUND = 'YES' WHERE ITEM_NAME =" + "'"+click+"'";
shoppingListDB.execSQL(update);