sqlite - Android row is not getting update -
i want update row values 0 or 1. here update method.where wrong code .
dbhelper.updatestarflag(actid, strstarflagmark); public boolean updatestarflag(string str_activityid, string str_starflag) { sqlitedatabase db1 = getreadabledatabase(); contentvalues args = new contentvalues(); args.put(col_allpost_postactivityid, str_activityid); args.put(col_allpost_starflag, str_starflag); int = db1.update(table_allpost_table, args, col_allpost_postactivityid + "='"+str_activityid+"'", null); return > 0; }
if want update something, need writable database. changed query little more in documentation sqlitedatabase
public boolean updatestarflag(string str_activityid, string str_starflag) { sqlitedatabase db1 = getwriteabledatabase(); contentvalues args = new contentvalues(); args.put(col_allpost_postactivityid, str_activityid); args.put(col_allpost_starflag, str_starflag); int = db1.update(table_allpost_table, args, col_allpost_postactivityid + "= ? ", new string[]{str_activityid}); return > 0; }
Comments
Post a Comment