Android Question JSON.NextObject returns Map in mixed order

grant1842

Active Member
Licensed User
Longtime User
Here's a simple JSON response:
{"First Name":"Jane","Last Name":"Doe","Address":"123 Main St."}

First I do:
Map = JSON.NextObject

Then:
Log(Map)

The result:
(MyMap) {Last Name=Smith, Address=123 Main St., First Name=John}

That's literally all I'm doing and the map is in a different order. Is there any way to preserve the order?
 
I'm dynamically loading information into a listview using the two line layout. Instead of manually typing the field names when doing Map.Get, I'm looping through the map and using Map.GetKeyAt for one line, and Map.GetValueAt for another line. Preservation of the order would allow me to finish this.

I'm doing it this way because let's say in the future I wanted to add another field to the JSON response. This way allows me to only make that change on the server. The dynamic loading of the fields will already take care of that change on the client.
 
Upvote 0
I appreciate the advice. I'm hoping it'd be possible for Erel to make it happen using the JSON.NextObject function.
 
Upvote 0
Back
Top