Search code examples
androidparse-platformjsonparserback4app

Convert JsonObject to ParseObject in Android


I am sending out ParseObject through push notification so that I may store them locally on the users device. How can make a ParseObject from the JsonObject which is coming through the notifications?


Solution

  • The Best way to do it is to use the ParseObject.fromJSON() method.

    It takes three parameters : JsonObject , DefaultClassName , ParseDecoder

    An example code would be :

    ParseDecoder decoder = ParseDecoder.get(); ParseObject obj = ParseObject.fromJSON(MyJsonObject,"object_class_name", decoder);