如何修复java.lang.reflect.invocationtargetexception android

时间:2014-09-15 10:59:25

标签: android sqlite

public int updateNotification(String notificationid, String isRead) {
        int result = 0;
        ContentValues values = new ContentValues();
        values.put(DataProviderConstants.NOTIFY_SENDER_ID, notificationid);
        values.put(DataProviderConstants.NOTIFY_STATUS, isRead);

        result = mContext.getContentResolver().update(
                DataProviderConstants.NOTIFICATION_TABLE_CONTENTURI, values,
                DataProviderConstants.NOTIFY_SENDER_ID + "=?",
                new String[] { notificationid });

        return result;
    }

此代码工作正常,我可以更新Sqlite表中的数据

public int UpdatetypeNotifcation(String notificationid, String notify_type) {
        int result1 = 0;
        ContentValues value = new ContentValues();
        value.put(DataProviderConstants.NOTIFY_SENDER_ID, notificationid);
        value.put(DataProviderConstants.NOTIFY_TYPE, notify_type);

        result1 = mContext.getContentResolver().update(
                DataProviderConstants.NOTIFICATION_TABLE_CONTENTURI, value,
                DataProviderConstants.NOTIFY_SENDER_ID + "=?",
                new String[] { notificationid });
        return result1;

    }

相同的代码我用于更新表与其他值和方法然后我得到以下异常java.lang.reflect.invocationtargetexception我不知道在哪里做错了请帮助

        result = mContext.getContentResolver().update(
                DataProviderConstants.NOTIFICATION_TABLE_CONTENTURI, values,
                DataProviderConstants.NOTIFY_SENDER_ID + "=?",
                new String[] { notificationid });

        return result;  this Line Exception is coming when i debug i don't know why this issue is coming please help 

并建议我:下面是Exception enter image description here

的屏幕截图

0 个答案:

没有答案