@@ -31,7 +31,7 @@ public class DefaultDownLoaderImpl implements DownloadListener, DownLoadResultLi
31
31
private boolean enableIndicator ;
32
32
private volatile static int NoticationID = 1 ;
33
33
private List <DownLoadResultListener > mDownLoadResultListeners ;
34
- private LinkedList <String > mList = new LinkedList <>() ;
34
+ static LinkedList <String > mList = null ;
35
35
private WeakReference <Activity > mActivityWeakReference = null ;
36
36
private DefaultMsgConfig .DownLoadMsgConfig mDownLoadMsgConfig = null ;
37
37
private static final String TAG = DefaultDownLoaderImpl .class .getSimpleName ();
@@ -144,7 +144,10 @@ private void preDownload(String url, String contentDisposition, long contentLeng
144
144
145
145
}
146
146
147
- if (mList .contains (url )) {
147
+ if (mList !=null ){
148
+ LogUtils .i (TAG ,"url:" +url +" list:" +mList );
149
+ }
150
+ if (mList !=null &&mList .contains (url )) {
148
151
149
152
AgentWebUtils .toastShowShort (mContext , mDownLoadMsgConfig .getTaskHasBeenExist ());
150
153
return ;
@@ -200,6 +203,9 @@ public void onClick(DialogInterface dialog, int which) {
200
203
201
204
private void performDownload (String url , long contentLength , File file ) {
202
205
206
+ if (mList == null ) {
207
+ mList = new LinkedList <>();
208
+ }
203
209
mList .add (url );
204
210
mList .add (file .getAbsolutePath ());
205
211
//并行下载.
@@ -236,7 +242,7 @@ private File getFile(String contentDisposition, String url) {
236
242
}
237
243
238
244
LogUtils .i (TAG , "file:" + filename );
239
- return AgentWebUtils .createFileByName (mContext ,filename ,false );
245
+ return AgentWebUtils .createFileByName (mContext , filename , false );
240
246
} catch (Exception e ) {
241
247
e .printStackTrace ();
242
248
}
0 commit comments