3
3
import android .app .AlertDialog ;
4
4
import android .content .Context ;
5
5
import android .content .DialogInterface ;
6
- import android .os .Handler ;
7
6
import android .os .Environment ;
8
7
import android .widget .ProgressBar ;
9
8
@@ -28,22 +27,17 @@ public class DownloadApkThread implements Runnable {
28
27
private String mSavePath ;
29
28
/* 记录进度条数量 */
30
29
private int progress ;
31
- /* 更新进度条 */
32
- private ProgressBar mProgress ;
33
30
/* 是否取消更新 */
34
31
private boolean cancelUpdate = false ;
35
32
private AlertDialog mDownloadDialog ;
36
33
private DownloadHandler downloadHandler ;
37
- private MsgHelper msgHelper ;
38
34
39
35
public DownloadApkThread (Context mContext , ProgressBar mProgress , AlertDialog mDownloadDialog , HashMap <String , String > mHashMap ) {
40
- this .mProgress = mProgress ;
41
36
this .mDownloadDialog = mDownloadDialog ;
42
37
this .mHashMap = mHashMap ;
43
38
44
- this .msgHelper = new MsgHelper (mContext .getPackageName (), mContext .getResources ());
45
39
this .mSavePath = Environment .getExternalStorageDirectory () + "/" + "download" ; // SD Path
46
- this .downloadHandler = new DownloadHandler (mContext , mProgress , mSavePath , mHashMap );
40
+ this .downloadHandler = new DownloadHandler (mContext , mProgress , mDownloadDialog , this . mSavePath , mHashMap );
47
41
}
48
42
49
43
@@ -95,8 +89,6 @@ private void downloadAndInstall() {
95
89
if (numread <= 0 ) {
96
90
// 下载完成
97
91
downloadHandler .sendEmptyMessage (Constants .DOWNLOAD_FINISH );
98
- mDownloadDialog .getButton (DialogInterface .BUTTON_NEGATIVE )
99
- .setText (msgHelper .getString (MsgHelper .UPDATE_COMPLETE ));
100
92
break ;
101
93
}
102
94
// 写入文件
0 commit comments