Example #1
0
  /** 从服务器下载新的Apk */
  private void downApk() {

    initProgressDialog();
    file = new File(ECApplication.getCacheDirPath(), "lazyman.apk");
    downLoadTask = new DownLoadTask(version.getUrl(), file.getAbsolutePath(), 5);
    downLoadTask.setListener(this);
    ThreadPoolManager.getInstance().addTask(downLoadTask);
  }
Example #2
0
 @Override
 protected void onDestroy() {
   super.onDestroy();
   if (downLoadTask != null) downLoadTask.cancel();
   downLoadTask = null;
   if (mProgressDialog != null) mProgressDialog.dismiss();
   mProgressDialog = null;
   file = null;
 }