Removed unnecessary communication with DownloadService
This commit is contained in:
parent
26c8772e0a
commit
c2054be460
|
@ -63,6 +63,14 @@ public class DownloadService extends Service {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||||
|
queryDownloads();
|
||||||
|
return super.onStartCommand(intent, flags, startId);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
Log.d(TAG, "Service started");
|
Log.d(TAG, "Service started");
|
||||||
|
|
|
@ -76,12 +76,11 @@ public class DownloadRequester {
|
||||||
// TODO Set Allowed Network Types
|
// TODO Set Allowed Network Types
|
||||||
DownloadManager manager = (DownloadManager) context
|
DownloadManager manager = (DownloadManager) context
|
||||||
.getSystemService(Context.DOWNLOAD_SERVICE);
|
.getSystemService(Context.DOWNLOAD_SERVICE);
|
||||||
context.startService(new Intent(context, DownloadService.class));
|
|
||||||
long downloadId = manager.enqueue(request);
|
long downloadId = manager.enqueue(request);
|
||||||
item.setDownloadId(downloadId);
|
item.setDownloadId(downloadId);
|
||||||
item.setFile_url(dest.toString());
|
item.setFile_url(dest.toString());
|
||||||
|
context.startService(new Intent(context, DownloadService.class));
|
||||||
notifyDownloadService(context);
|
|
||||||
return downloadId;
|
return downloadId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue