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
Post a Comment