码迷,mamicode.com
首页 > 其他好文 > 详细

新建 SecondPresenter 实现类

时间:2019-08-04 19:58:49      阅读:105      评论:0      收藏:0      [点我收藏+]

标签:and   www   body   data   vpd   class   baidu   callback   failure   

package com.test.mvp.mvpdemo.mvp.v6.presenter;

import com.test.mvp.mvpdemo.mvp.v6.SecondContract;
import com.test.mvp.mvpdemo.mvp.v6.basemvp.BasePresenter;
import com.test.mvp.mvpdemo.mvp.v6.model.SecondModel;
import java.io.IOException;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.Response;

public class SecondPresenter extends BasePresenter<SecondContract.ISecondView, SecondModel> implements SecondContract.ISecondPresenter {

@Override
public void handlerData() {
getView().showDialog();

getModel().requestBaidu(new Callback() {
@Override
public void onFailure(Call call, IOException e) {
}

@Override
public void onResponse(Call call, Response response) throws IOException {
String content = response.body().string(http://www.amjmh.com);
getView().succes(content);
}
});
}
}

新建 SecondPresenter 实现类

标签:and   www   body   data   vpd   class   baidu   callback   failure   

原文地址:https://www.cnblogs.com/ly570/p/11299123.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!