gpt4 book ai didi

java.lang.IllegalArgumentException : Empty values

转载 作者:行者123 更新时间:2023-12-02 10:27:23 25 4
gpt4 key购买 nike

错误

FATAL EXCEPTION: main
Process: com.appmaster.akash.messageplus, PID: 6468
java.lang.IllegalArgumentException: Empty values
at android.database.sqlite.SQLiteDatabase.updateWithOnConflict(SQLiteDatabase.java:1545)
at android.database.sqlite.SQLiteDatabase.update(SQLiteDatabase.java:1525)
at com.appmaster.akash.messageplus.Chat$8.onDataChange(Chat.java:783)
at com.google.android.gms.internal.zzduz.zza(Unknown Source:13)
at com.google.android.gms.internal.zzdwu.zzbvb(Unknown Source:2)
at com.google.android.gms.internal.zzdxa.run(Unknown Source:65)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6541)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
12-19 15:11:35.658 1957-2011/system_process E/memtrack: Couldn't load memtrack module

代码

 if(mSeen!=null && mSeen.equals("No")) {
if (mTime < seen)
contentValues.put(KEY_SEEN, "Yes"); //Change the value of newData(which is actually your old value) by incrementing
long returnVariable = db.update(TABLE_CHAT_DATA, contentValues, null, null);
if (returnVariable == -1) {
Toast.makeText(getApplication(), "Nope", Toast.LENGTH_LONG).show();
//-1 means there was an error updating the values
} else {
Toast.makeText(getApplication(), "SEEEEEEN", Toast.LENGTH_SHORT).show();
}

}

错误出现在更新行...我不明白这一点,因为数据就在那里并且仍然显示空值。有人可以帮帮我吗

最佳答案

将第一个 if 语句的内容放在括号中。缺少括号,因此第二行始终执行,无论 if (我假设您没有提前为 contentValues 输入值)。

                  if (mTime < seen) { //// HERE
contentValues.put(KEY_SEEN, "Yes"); //Change the value of newData(which is actually your old value) by incrementing
long returnVariable = db.update(TABLE_CHAT_DATA, contentValues, null, null);
} /// AND HERE
if (returnVariable == -1) {
Toast.makeText(getApplication(), "Nope", Toast.LENGTH_LONG).show();
//-1 means there was an error updating the values
} else {
Toast.makeText(getApplication(), "SEEEEEEN", Toast.LENGTH_SHORT).show();
}

关于java.lang.IllegalArgumentException : Empty values,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53848529/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com