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);
|
||||
|
||||
downloadCompletionThread.interrupt();
|
||||
try {
|
||||
downloadCompletionThread.join();
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
syncExecutor.shutdown();
|
||||
schedExecutor.shutdown();
|
||||
cancelNotificationUpdater();
|
||||
|
|
Loading…
Reference in New Issue