package cn.net.caoyao.cpzshandset.service.apkupdate;

import android.content.Context;
import android.os.Handler;
import android.widget.ImageView;
import android.widget.ProgressBar;

/**
 * 
 * 回调请求
 * 
 * @author Administrator
 * 
 */
public class CallBackUtils {

	public static final int OK = 1;
	public static final int ERROR = -1;

	/**
	 * 获取302号协议的数据
	 * 
	 * @param retrospectCode
	 * @param callBackOK
	 * @param callBackError
	 */
	/*public static void getBannerInfo(final CallBackOK callBackOK, final CallBackError callBackError,int times) {
		Handler handler = new Handler() {
			public void handleMessage(android.os.Message msg) {
				switch (msg.what) {
				case OK:
					LogUtils.d("-------->>网络OK");
					callBackOK.ok( msg.obj);
					break;
				case ERROR:
					LogUtils.d("-------->>网络ERROR");
					callBackError.error();
					break;
				default:
					break;
				}
			};
		};
		new Thread(new ThreadBannerInfo(handler,times)).start();
	}
*/
	
	/**
	 * 获取302号协议的数据
	 * 
	 * @param callBackOK
	 * @param callBackError
	 */
	public static void getBannerInfo2(final CallBackOK callBackOK, final CallBackError callBackError) {
		Context mContext = null;
		ImageView imageView_verify_pictrue = null;
		String bitmapUrl = null;
		ProgressBar mProgressBar = null;
		@SuppressWarnings("unused")
		Handler handler = new Handler() {
			public void handleMessage(android.os.Message msg) {
				switch (msg.what) {
				case OK:
					callBackOK.ok( msg.obj);
					break;
				case ERROR:
					callBackError.error();
					break;
				default:
					break;
				}
			};
		};
//		new ImageAsyncTask(mContext, imageView_verify_pictrue, bitmapUrl,mProgressBar).execute("");
	}
	
	
	
	public interface CallBackOK {
		void ok(Object object);
	}

	public interface CallBackError {
		void error();
	}
}
