============ Problem Description ============
The data can't be updated! I don't know what the problem is. The great God came in and looked. The return is always false!
The code is attached!
public boolean update (String useraccount,string username,drawable uinfo) {
byte[] Picture = Pictureturn.bitmap2bytes (Pictureturn
. Drawable2bitmap (Uinfo));
System.out.println ("----------------->" +picture);
System.out.println ("----------useraccount------->" +useraccount);
Boolean result = false;
db = Sqa.getreadabledatabase ();
CV = new Contentvalues ();
Cv.put ("UserAccount", UserAccount);
Cv.put ("username", username);
Cv.put ("Picture", picture);
Long B = db.update ("User", CV, "useraccount=" +useraccount,
New string[]{});
if (b > 0) {
result = true;
}
Db.close ();
return result;
}
============ Solution 1============
Long B = db.update ("User", CV, "useraccount=" +useraccount, New string[]{}); This error, update is not so used, should be changed to
Long B = db.update ("User", CV, "useraccount=?", New String[]{useraccount});
============ Solution 2============
The whole picture should not be stored in the database, the path to save the picture is better.
The Android database is always not updated with update updates, and no exceptions are thrown!