步骤:
1.创建assets文件放入json数据
2.根据json创建bean类
3.解析成我们要的数据
try {
InputStream inputStream = this.getAssets().open("lunyu.json");
String streamToString = UtilsStream.convertStreamToString(inputStream);
Gson gson=new Gson();
lunYuBeanList = gson.fromJson(streamToString, new TypeToken<List<LunYuBean>>() {}.getType());
} catch (Exception e) {
Log.d(TAG, "initView: "+e.getMessage());
}