novoda / download-manager

A library that handles long-running downloads, handling the network interactions and retrying downloads automatically after failures
Apache License 2.0
483 stars 63 forks source link

Create service connection listener after liteDownloadManager #513

Closed zegnus closed 5 years ago

zegnus commented 5 years ago

This is a manual PR from https://github.com/novoda/download-manager/pull/511

Quote: In my application onServiceConnected seems to sometimes get called immediately after applicationContext.bindService(...) is called, which causes a crash, because liteDownloadManager is not initialized yet. This PR calls bindService after liteDownloadManager is initialized to eliminate the possibility of this crash.

Fixes #510