use of huyifei.mymvp.architecture.common.DownloadCallback in project My-MVP by REBOOTERS.
the class MVCActivity method init.
private void init() {
// view init
mImageView = (ImageView) findViewById(R.id.image);
progressDialog = new ProgressDialog(mContext);
progressDialog.setButton(DialogInterface.BUTTON_NEGATIVE, "Cancle", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
progressDialog.dismiss();
}
});
progressDialog.setCanceledOnTouchOutside(false);
progressDialog.setTitle("下载文件");
progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
// click-event
findViewById(R.id.downloadBtn).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
progressDialog.show();
HttpUtil.HttpGet(Constants.DOWNLOAD_URL, new DownloadCallback(mHandler));
}
});
findViewById(R.id.downloadBtn1).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
progressDialog.show();
HttpUtil.HttpGet(Constants.DOWNLOAD_ERROR_URL, new DownloadCallback(mHandler));
}
});
Looper mLooper = getMainLooper();
Thread mThread = mLooper.getThread();
String threadName = mThread.getName();
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {
MessageQueue mMessageQueue = mLooper.getQueue();
}
Log.e(TAG, "threadName: " + threadName);
}
Aggregations