Wait for downloadCompletionThread to finish before stopping executors used by the thread
This commit is contained in:
parent
cb3b1f2b1f
commit
c752d90f4f
|
@ -218,6 +218,11 @@ public class DownloadService extends Service {
|
||||||
nm.cancel(NOTIFICATION_ID);
|
nm.cancel(NOTIFICATION_ID);
|
||||||
|
|
||||||
downloadCompletionThread.interrupt();
|
downloadCompletionThread.interrupt();
|
||||||
|
try {
|
||||||
|
downloadCompletionThread.join();
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
syncExecutor.shutdown();
|
syncExecutor.shutdown();
|
||||||
schedExecutor.shutdown();
|
schedExecutor.shutdown();
|
||||||
cancelNotificationUpdater();
|
cancelNotificationUpdater();
|
||||||
|
|
Loading…
Reference in New Issue