// Path: qshttp/src/main/java/org/song/http/framework/ability/HttpCallback.java
// public interface HttpCallback {
// 
//     void onSuccess(ResponseParams response);
// 
//     void onFailure(HttpException e);
// 
// }
// 
// Path: qshttp/src/main/java/org/song/http/framework/ability/HttpCallbackEx.java
// public interface HttpCallbackEx extends HttpCallback {
// 
//     void onStart();
// 
//     void onEnd();
// 
//     //返回true 则不会回调
//     boolean isDestroy();
// }
// 
// Path: qshttp/src/main/java/org/song/http/framework/ability/IHttpProgress.java
// public interface IHttpProgress {
//     //当前进度 文件大小 文件名/标记
//     void onProgress(long rwLen, long allLen, String mark);
// 
// }


import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import org.song.http.framework.ability.HttpCallback;
import org.song.http.framework.ability.HttpCallbackEx;
import org.song.http.framework.ability.IHttpProgress;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
package org.song.http.framework;




/*
 * Created by song on 2016/9/18.
 * 子线程联网任务 回调主线程 类
 */
public class ThreadHandler extends Handler {

    private int mThreadWhat = 19930411;
    private Map<Integer, HttpCallback> sparseArray = new ConcurrentHashMap<>();
//    private SparseArray<HttpCallback> sparseArray = new SparseArray<>();

    private ThreadHandler() {
        super(Looper.getMainLooper());
    }

    private static ThreadHandler instance;

    private static ThreadHandler getInstance() {
        if (instance == null)
            instance = new ThreadHandler();
        return instance;
    }


    public synchronized int addHttpDataCallback(final HttpCallback cb) {
        mThreadWhat++;
        sparseArray.put(mThreadWhat, cb);
// Path: qshttp/src/main/java/org/song/http/framework/ability/HttpCallback.java
// public interface HttpCallback {
// 
//     void onSuccess(ResponseParams response);
// 
//     void onFailure(HttpException e);
// 
// }
// 
// Path: qshttp/src/main/java/org/song/http/framework/ability/HttpCallbackEx.java
// public interface HttpCallbackEx extends HttpCallback {
// 
//     void onStart();
// 
//     void onEnd();
// 
//     //返回true 则不会回调
//     boolean isDestroy();
// }
// 
// Path: qshttp/src/main/java/org/song/http/framework/ability/IHttpProgress.java
// public interface IHttpProgress {
//     //当前进度 文件大小 文件名/标记
//     void onProgress(long rwLen, long allLen, String mark);
// 
// }


// Path: qshttp/src/main/java/org/song/http/framework/ThreadHandler.java
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import org.song.http.framework.ability.HttpCallback;
import org.song.http.framework.ability.HttpCallbackEx;
import org.song.http.framework.ability.IHttpProgress;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

package org.song.http.framework;




/*
 * Created by song on 2016/9/18.
 * 子线程联网任务 回调主线程 类
 */
public class ThreadHandler extends Handler {

    private int mThreadWhat = 19930411;
    private Map<Integer, HttpCallback> sparseArray = new ConcurrentHashMap<>();
//    private SparseArray<HttpCallback> sparseArray = new SparseArray<>();

    private ThreadHandler() {
        super(Looper.getMainLooper());
    }

    private static ThreadHandler instance;

    private static ThreadHandler getInstance() {
        if (instance == null)
            instance = new ThreadHandler();
        return instance;
    }


    public synchronized int addHttpDataCallback(final HttpCallback cb) {
        mThreadWhat++;
        sparseArray.put(mThreadWhat, cb);
        if (cb instanceof HttpCallbackEx) {