在领券联盟中,跟视频做到p77时,在没给特惠界面加判断时,recyclerview里边内容为空;加了状态判断后,进去了特惠界面当loading完了后直接显示了个网络错误。 这个是因为在presenter层中获取特惠结果时候出错。
@Override
public void onFailure(Call<OnSellContent> call,Throwable t) {
LogUtils.d(OnSellPagePresenter.class,"error --- >" + t.toString());
onError();
}
打的log是 error --- >com.google.gson.JsonSyntaxException: java.lang.NumberFormatException: Expected an int but was 3426733234 at line 1 column 5042 path $.data.tbk_dg_optimus_material_response.result_list.map_data[1].seller_id
这个具体是啥意思啊。。。百度下说这个是数据格式化异常,把特惠的接口重新用postman请求一下
http://api.sunofbeach.net/shop/onSell/1
用返回的数据重新去GsonFrmat一下,特惠的界面就可以正常显示