majidgolshadi / Android-Download-Manager-Pro

Android/Java download manager library help you to download files in parallel mechanism in some chunks.
MIT License
1.62k stars 317 forks source link

Crash application when i try to pause when onStop trigger #42

Open pishguy opened 7 years ago

pishguy commented 7 years ago

I'm trying to pause current download on onStop by this code:

@Override
protected void onStop() {
    super.onStop();
    Alachiq.getDefaultInstance().pauseDownload(Alachiq.getDefaultInstance().getCurrentDownloadingTaskId());

    EventBus.getDefault().unregister(this);
}

public int getCurrentTask(){
    int thisTask = 0;
    String query = "SELECT * FROM " + TABLES.TASKS
            + " WHERE " + TASKS.COLUMN_STATE + "==" + SqlString.Int(TaskStates.DOWNLOADING);

    ...
}

but i get an error on this line of code

.core.chunkWorker.ConnectionWatchDog.run(ConnectionWatchDog.java:56)