|
|
@@ -133,28 +133,30 @@ public class FgtSearch extends BaseFragment implements ISearch {
|
|
|
if (base.has("roleCount")) {
|
|
|
roleCount += base.getInt("roleCount");
|
|
|
}
|
|
|
- JSONArray array = base.getJSONArray("list");
|
|
|
- for (int i = 0; i < array.length(); i++) {
|
|
|
- JSONObject object = array.getJSONObject(i);
|
|
|
- SearchItem item = new SearchItem();
|
|
|
- item.type = object.getInt("type");
|
|
|
- item.data = object.getString("data");
|
|
|
- if (item.type == 1) {
|
|
|
- item.object = com.alibaba.fastjson.JSONObject.parseObject(item.data, Applications.class);
|
|
|
- } else if (item.type == 2) {
|
|
|
- item.object = com.alibaba.fastjson.JSONObject.parseObject(item.data, TaskSimple.class);
|
|
|
- } else if (item.type == 3) {
|
|
|
- item.object = com.alibaba.fastjson.JSONObject.parseObject(item.data, GiftBagApp.class);
|
|
|
- } else if (item.type == 4) {
|
|
|
- item.object = com.alibaba.fastjson.JSONObject.parseObject(item.data, Article.class);
|
|
|
- } else if (item.type == 5) {
|
|
|
- item.object = com.alibaba.fastjson.JSONObject.parseObject(item.data, ShopGoodsInfo.class);
|
|
|
- } else if (item.type == 6) {
|
|
|
- item.object = com.alibaba.fastjson.JSONObject.parseObject(item.data, GameAvatar.class);
|
|
|
- } else {
|
|
|
- continue;
|
|
|
+ if (base.has("list")) {
|
|
|
+ JSONArray array = base.getJSONArray("list");
|
|
|
+ for (int i = 0; i < array.length(); i++) {
|
|
|
+ JSONObject object = array.getJSONObject(i);
|
|
|
+ SearchItem item = new SearchItem();
|
|
|
+ item.type = object.getInt("type");
|
|
|
+ item.data = object.getString("data");
|
|
|
+ if (item.type == 1) {
|
|
|
+ item.object = com.alibaba.fastjson.JSONObject.parseObject(item.data, Applications.class);
|
|
|
+ } else if (item.type == 2) {
|
|
|
+ item.object = com.alibaba.fastjson.JSONObject.parseObject(item.data, TaskSimple.class);
|
|
|
+ } else if (item.type == 3) {
|
|
|
+ item.object = com.alibaba.fastjson.JSONObject.parseObject(item.data, GiftBagApp.class);
|
|
|
+ } else if (item.type == 4) {
|
|
|
+ item.object = com.alibaba.fastjson.JSONObject.parseObject(item.data, Article.class);
|
|
|
+ } else if (item.type == 5) {
|
|
|
+ item.object = com.alibaba.fastjson.JSONObject.parseObject(item.data, ShopGoodsInfo.class);
|
|
|
+ } else if (item.type == 6) {
|
|
|
+ item.object = com.alibaba.fastjson.JSONObject.parseObject(item.data, GameAvatar.class);
|
|
|
+ } else {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ items.add(item);
|
|
|
}
|
|
|
- items.add(item);
|
|
|
}
|
|
|
if (isRefresh) {
|
|
|
listAdapter.setItems(items);
|