开发者

Null Pointer Exception when using delete

开发者 https://www.devze.com 2023-01-07 23:37 出处:网络
AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo(); dDbHelper.deletedJournal(info.id);
 AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();

                dDbHelper.deletedJournal(info.id);
                mDbHelper.deleteJournal(info.id);


public bo开发者_StackOverflowolean deletedJournal(long homeId){

        return mDb.delete(DATABASE_TABLE, KEY_HOMEID + "=" + homeId, null )>0;
    }

dDbHelper.deletedJournal(info.id) gives me a null pointer exception


I'm betting that info is null. This might be helpful:

Why is MenuItem.AdapterContextMenuInfo null when my list view has a custom adapter?


Either dDbHelper or info is null.

0

精彩评论

暂无评论...
验证码 换一张
取 消