package com.pencilbox.netknight.presentor;

import android.os.AsyncTask;

import com.pencilbox.netknight.model.DemoModel;
import com.pencilbox.netknight.view.IDemoView;

/**
 * Created by pencil-box on 16/6/9.
 */
public class DemoPresenter implements IDemoPresenter {


    private IDemoView mIDemoView;


    public DemoPresenter(IDemoView iDemoView) {

        mIDemoView = iDemoView;


    }

    @Override
    public void doSomeThing() {

        new AsyncTask<Void, Void, String>() {
            @Override
            protected String doInBackground(Void... voids) {


                //执行耗时操作,如网络或者其他请求
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                DemoModel demoModel = new DemoModel("#123");
                return demoModel.getDemoId();
            }

            @Override
            protected void onPostExecute(String s) {
                super.onPostExecute(s);

                mIDemoView.onDemoResult(s);

            }
        }.execute();


    }
}

@@ -296,24 +296,26 @@
 DemoView;%0A%0A%0A
+%0A%0A
     public D
@@ -347,17 +347,16 @@
 emoView)
- 
 %7B%0A%0A     
@@ -1092,20 +1092,21 @@
 xecute();%0A%0A%0A
+%0A
     %7D%0A%7D%0A

Revert "format the code"