This is due to the fact that all values except the primary key are null when executing UPDATE SQL.
if (flag) {
db.execSQL(sql.toString(), valueTempList.toArray());
}
Just add a judgment to it.