Search code examples
androidjsondollar-sign

How to get a JSON with dollar sign


suppose I have {"data": {"243232": {"id": "testid","name": "test" } }}

so how to get correct value thanks.


Solution

  • you cant directly pass above String with Gson as "243232" is number and we cant declare variable which start from number, So for parsing this you must modify the string with some notification

    i.e. {"data": {"temp243232": {"id": "testid","name": "test" } }}

    here i modified string manually "243232" by "temp243232", now you can parse it