android - Convert JSONObject to ParseObject -


i using parse cloud code, have set return type of cloud code list<parseobject>.

parsecloud.callfunctioninbackground("getobjects", params, new                 functioncallback<list<parseobject>>() {                     @override                     public void done(list<parseobject> objects, parseexception e) {                         if (e == null) {                             //                         } else {                             e.printstacktrace();                         }                     }                 }); 

when query 5 objects, can retrieve parseobjects, don't face problem, when query lot of objects, error

caused by: java.lang.classcastexception: org.json.jsonobject$1 cannot cast com.parse.parseobject".  

i have done research, cloud code happened return jsonobject, why able retrieve 5 objects parse objects when comes many objects, type returned jsonobject?

check if parse cloud code retrieving json or object.

check line this:

res.success(json.stringify(results)) 

and change to:

res.success(results) 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -