parse.com - How to reconsitute a Date object from a Cloud Function using the Android SDK? -


i have cloud code function returns date. goes across wire json, follows:

{      "result":{         "__type":"date",       "iso":"2033-07-09t23:50:11.450z"    } } 

now, in android sdk, want reconstitute json string date object. i've tried doing this:

parsecloud.callfunctioninbackground("getsubscriptionexpirydate", params, new functioncallback<date>() {     @override     public void done(date date, parseexception e) {...} });  

...but classcastexception.

if functioncallback< jsonobject>, or functioncallback< date> get:

java.lang.classcastexception: org.json.jsonobject$1 cannot cast org.json.jsonobject        @ com.app.helper.parseconnectionhelper$1.done(parseconnectionhelper.java:70)        @ com.parse.functioncallback.internaldone(functioncallback.java:44) 

what's proper way this?


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -