Gson gson = new Gson();
Type type = new TypeToken<><baselistdatabean&lt;chapterbean&gt;>>() {}.getType();
try {
result = gson.fromJson(json, type);
记录最后章节id
ArrayList&lt;ChapterBean&gt; data = result.getData().getData();
spUtil.putString(book_id2 + "_stChapterId", data.get(data.size()-1).getId());
spUtil.putInt("chap_count_" + book_id2, data.size());
} catch (JsonSyntaxException e) {
数据解析失败
ToastAlone.show(mContext, "数据解析失败");
e.printStackTrace();
return;
}
if (null == result || null == result.getData()
|| !"1".equals(result.getResult())) {
ToastAlone.show(mContext, result.getError_msg());
} else {
保存章节总数
spUtil.putInt("chap_count_" + book_id, result.getData().getData().size());
BookFileUtils.saveBookDirectory(json, book_id2);
}
handler.sendEmptyMessage(2);BaseDataBean<baselistdatabean&lt;chapterbean&gt;> result;
Gson gson = new Gson();
Type type = new TypeToken<><baselistdatabean&lt;chapterbean&gt;>>() {}.getType();
try {
result = gson.fromJson(json, type);
记录最后章节id
ArrayList&lt;ChapterBean&gt; data = result.getData().getData();
spUtil.putString(book_id2 + "_stChapterId", data.get(data.size()-1).getId());
spUtil.putInt("chap_count_" + book_id2, data.size());
} catch (JsonSyntaxException e) {
数据解析失败
ToastAlone.show(mContext, "数据解析失败");
e.printStackTrace();
return;
}
if (null == result || null == result.getData()
|| !"1".equals(result.getResult())) {
ToastAlone.show(mContext, result.getError_msg());
} else {
保存章节总数
spUtil.putInt("chap_count_" + book_id, result.getData().getData().size());
BookFileUtils.saveBookDirectory(json, book_id2);
}
handler.sendEmptyMessage(2);</baselistdatabean&lt;chapterbean&gt;></baselistdatabean&lt;chapterbean&gt;></baselistdatabean&lt;chapterbean&gt;></baselistdatabean&lt;chapterbean&gt;></baselistdatabean&lt;chapterbean&gt;></baselistdatabean&lt;chapterbean&gt;></baselistdatabean&lt;chapterbean&gt;></baselistdatabean&lt;chapterbean&gt;>@@
Copyright 2021宝石小说All Rights Reserved