Skip to content

Commit

Permalink
Fix stop method #268 (#311)
Browse files Browse the repository at this point in the history
  • Loading branch information
ValentinPostindustria authored Dec 8, 2021
1 parent 9af9911 commit 06cc8fd
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,15 @@ void setPeriodMillis(int periodMillis) {
}

void stop() {
if (requestRunnable != null) {
this.requestRunnable.cancelRequest();
if (state != STATE.DESTROYED) {
if (requestRunnable != null) {
this.requestRunnable.cancelRequest();
}
this.fetcherHandler.removeCallbacks(requestRunnable);
// cancel existing requests
timePausedAt = System.currentTimeMillis();
state = STATE.STOPPED;
}
this.fetcherHandler.removeCallbacks(requestRunnable);
// cancel existing requests
timePausedAt = System.currentTimeMillis();
state = STATE.STOPPED;
}

void start() {
Expand Down

0 comments on commit 06cc8fd

Please sign in to comment.