新建一个type传入即可 12Type type = new TypeToken<HashMap<String, Integer>>() {}.getType(); HashMap<String,Integer> map = new Gson().fromJson(json, type);