android - No success with retrieving from parse -
i'm trying read parseobject. have class on there , i'm trying messages there last message sent device.
so if send 2 messages last 1 sent.
can me?
this 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) { date time = (date) smsobject.get("date"); mymsg = (string) smsobject.get("message"); usrnum = (string) smsobject.get("phonenumber"); //happend = (boolean) smsobject.get("happend"); result = time; } } else { } } }); if (system.currenttimemillis() >= result.gettime()&& happend == false) { // count++; sendmsg2(mymsg, usrnum); happend = true; }
use
for (parseobject smsobject : objects) { date time = (date) smsobject.get("date"); mymsg = (string) smsobject.get("message"); usrnum = (string) smsobject.get("phonenumber"); //happend = (boolean) smsobject.get("happend"); result = time; if (system.currenttimemillis() >= result.gettime()&& happend == false) { // count++; sendmsg2(mymsg, usrnum); happend = true; } }
hope solve problem
Comments
Post a Comment