android - Could not parse boolean values in parse -
i trying parse boolean
value after using parseobject
, cannot parse it?
here code:
parsequery<parseobject> query = parsequery.getquery("smstable"); query.whereequalto("deviceid", android_id); query.findinbackground(new findcallback<parseobject>() { @override public void done(list<parseobject> objects, com.parse.parseexception e) { if (e == null) { (parseobject smsobject : objects) { if (smsobject!=null) { date time = (date) smsobject.get("date"); mymsg = (string) smsobject.get("message"); usrnum = (string) smsobject.get("phonenumber"); happend = (boolean) smsobject.get("happend"); result = time; } if (result != null) { if (system.currenttimemillis() >= result.gettime() && happend == false) { // count++; if (usrnum != null && mymsg != null) { log.d("message", mymsg); log.d("time", string.valueof(result)); sendmsg2(mymsg, usrnum); smsobject.put("happend", true); } } } } } } });
you should call default methods of parseobject retrieve data instead of parsing :
parsequery<parseobject> query = parsequery.getquery("smstable"); query.whereequalto("deviceid", android_id); query.findinbackground(new findcallback<parseobject>() { @override public void done(list<parseobject> objects, com.parse.parseexception e) { if (e == null) { (parseobject smsobject : objects) { if (smsobject!=null) { date time = smsobject.getdate("date"); mymsg = smsobject.getstring("message"); usrnum = smsobject.getstring("phonenumber"); happend = smsobject.getboolean("happend"); result = time; } if (result != null) { if (system.currenttimemillis() >= result.gettime() && happend == false) { // count++; if (usrnum != null && mymsg != null) { log.d("message", mymsg); log.d("time", string.valueof(result)); sendmsg2(mymsg, usrnum); smsobject.put("happend", true); } } } } } }
});
Comments
Post a Comment