android.database.sqlite.SQLiteException: near “where”: syntax error (code 1): ,

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.

Read More: