realm不支持hashmap這種形式
stackoverflow給出了解決方案
http://stackoverflow.com/ques...
class MyData extends RealmObject { private RealmList<MyMap> myMap; }class MyMap extends RealmObject { private String key; private MyClass value; }
但是我用gson解析時(shí)會(huì)報(bào)錯(cuò)
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2656 path $.layers[0].icons
因?yàn)閙ap是一個(gè)對(duì)象,而private RealmList<MyMap> myMap;是一個(gè)數(shù)組
應(yīng)該怎樣解析呢?