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

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -