AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();
dDbHelper.deletedJournal(info.id);
mDbHelper.deleteJournal(info.id);
public boolean deletedJournal(long homeId){
return mDb.delete(DATABASE_TABLE, KEY_HOMEID + "=" + homeId, null )>0;
}
dDbHelper.deletedJournal(info.id)
给了我一个空指针异常
答案 0 :(得分:1)
我打赌信息为空。这可能会有所帮助:
Why is MenuItem.AdapterContextMenuInfo null when my list view has a custom adapter?
答案 1 :(得分:0)
dDbHelper
或info
为null
。