I have a JSON array returning from a request.
Data is as such (it comes from external source and cannot be changed from server):
[{\"clients\":
{\"name\":\"
First, the exception you're seeing is because the selector name is incorrect. You should use keysSortedByValueUsingComparator
.
Second, you can't sort the keys, because the order in which you're getting them from the server doesn't seem to be in any particular order. If you MUST have them in that order, then send them from the server with a tag ("index") and then sort by this tag.