database - Parse update and deletion not working android -


i working android apis , per have done same instructed. here code

update.setonclicklistener(new view.onclicklistener() {      @override     public void onclick(view v) {         // todo auto-generated method stub         parsequery<parseobject> query = parsequery                 .getquery("gamescore");         query.whereequalto("playername", user.gettext().tostring());         query.findinbackground(new findcallback<parseobject>() {              @override             public void done(list<parseobject> arg0, parseexception arg1) {                 // todo auto-generated method stub                 if (arg1 == null) {                     if(arg0.size()!=0)                     {                     final parseobject delo = arg0.get(0);                     toast.maketext(getapplicationcontext(),                             "got : " + arg0.size() + "  " + delo.getobjectid(),                             toast.length_short).show();                      string objid = delo.getobjectid();                     parsequery<parseobject> newquery = parsequery.getquery("gamescore");                     newquery.getinbackground(objid, new getcallback<parseobject>() {                          @override                         public void done(parseobject arg0, parseexception arg1) {                             // todo auto-generated method stub                             if(arg1==null)                             {                             toast.maketext(getapplicationcontext(), "no error", toast.length_short).show();                             string scor = score.gettext().tostring();                             int iscore = integer.parseint(scor);                               arg0.put("score", iscore);                             toast.maketext(getapplicationcontext(), "updated", toast.length_short).show();                             arg0.saveinbackground();                             }else                             {                                 toast.maketext(getapplicationcontext(), "error", toast.length_short).show();                             }                         }                     });                      }                     else{                         toast.maketext(getapplicationcontext(),                                 "nothing show",                                 toast.length_short).show();                     }                  } else {                     toast.maketext(getapplicationcontext(),                             "we got crashed" + arg0.size(),                             toast.length_short).show();                 }             }         });     } }); 

nothing changed in database.

i thought may problem due permission added this:

defaultacl.setpublicwriteaccess(true);

and still nothing changed went basic , wrote this:

parsequery<parseobject> query = parsequery.getquery("gamescore"); query.getinbackground("a26wazg8mj", new getcallback<parseobject>() {      @override     public void done(parseobject arg0, parseexception arg1) {         // todo auto-generated method stub         if(arg1==null){         arg0.put("playername", "cheated");         arg0.saveinbackground();         system.out.println("saved");         }     } }); 

and still nothing happens please me.

also facing problem deleting single row. tried , doesn't work well.

i got permissions set individual objects not entire class why not able write(update) or delete one's created after adding aclpermission code worked well.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -