android - database update method unable to accept integer value -
this further question earlier, on db.update.
i'm used code karakuri's suggested , modified database adapter method following. note fma in integer number (34, actually) database adapter got mainactivity
public void updatej(int fma){ string = "coli = ?"; contentvalues arw = new contentvalues(); cv.put("coli", fma); below no longer used null last argument instead // string jusi = integer.tostring(fma); // string[] whereargs = new string[] {jusi}; //log.w(tag, "whereargs = " + whereargs); db.update("supertable", cv, where, null); }
it still not work. // previous 'the log.w reads 06-02 16:24:31.695: w/dba information(18940): whereargs = [ljava.lang.string;@5299a034'
//but have question after reading online tutorials , android website , karakuri's explanation fourth argument whereargs suppose string[] instead of string or int. column 'coli' in supertable integer design. how go making accept int rather string[]?
i've replaced whereargs null , use cv.put directly using int fma variable, still doesn't work? converted int string before putting in , doesnt work also.
it still not work. // previous 'the log.w reads 06-02 16:24:31.695: w/dba information(18940): whereargs = [ljava.lang.string;@5299a034'
you don't pass whereargs
update()
, that's why "does not work". change
db.update("supertable", cv, where, null);
to
db.update("supertable", cv, where, whereargs);
the log output 1 expect when calling tostring()
on string[]
string array.
Comments
Post a Comment