I have the following code:
ArrayList<HashMap<String,String>> arr = new ArrayList<HashMap<String,String>>();
arr.add(new HashMap<String, String>(){{
put("title","123");
put("link","456");
}});
print(arr.toString());
print(new Gson().toJson(arr));
and I get the following output:
[{link=456, title=123}]
[null]
But I hope it is:
[{link=456, title=123}]
[{"title":"123","link":"456"}] //Serialize ArrayList<HashMap> via GSON
I searched a lot of posts, I have no idea. thanks for any response.