package com.chenql.multitaskdemo;

import android.os.AsyncTask;
import android.os.SystemClock;
import android.util.Log;

/**
 * TestTask
 * Created by chinglimchan on 18/10/2016.
 */

public class TestTask extends AsyncTask<Void, Void, Void> {

    private final String TAG = TestTask.class.getSimpleName();
    private String msg;

    public TestTask(String msg) {
        this.msg = msg;
    }

    @Override
    protected Void doInBackground(Void... params) {
        SystemClock.sleep(1000);
        Log.d(TAG, msg + " runs");
        return null;
    }

    @Override
    protected void onPostExecute(Void aVoid) {
        super.onPostExecute(aVoid);
        Log.d(TAG, msg + " end");
    }
}
