From 08306842239a03686eac5c06412ddc01947ee85a Mon Sep 17 00:00:00 2001 From: Olmo Gallegos Date: Tue, 28 Aug 2018 11:37:47 +0200 Subject: [PATCH] Fix #72 by avoiding notifying failure then success --- .../library/remote/DownloadFileUrlConnectionImpl.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/library/src/main/java/es/voghdev/pdfviewpager/library/remote/DownloadFileUrlConnectionImpl.java b/library/src/main/java/es/voghdev/pdfviewpager/library/remote/DownloadFileUrlConnectionImpl.java index d880fbc..5bb1dcc 100644 --- a/library/src/main/java/es/voghdev/pdfviewpager/library/remote/DownloadFileUrlConnectionImpl.java +++ b/library/src/main/java/es/voghdev/pdfviewpager/library/remote/DownloadFileUrlConnectionImpl.java @@ -74,13 +74,12 @@ public void run() { urlConnection.disconnect(); fileOutput.close(); + notifySuccessOnUiThread(url, destinationPath); } catch (MalformedURLException e) { notifyFailureOnUiThread(e); } catch (IOException e) { notifyFailureOnUiThread(e); } - - notifySuccessOnUiThread(url, destinationPath); } }).start(); }