From c100d15ba8324019b100e537b7c68fba3b427cd9 Mon Sep 17 00:00:00 2001 From: mauriciocolli Date: Fri, 17 Mar 2017 11:50:27 -0300 Subject: [PATCH] Fix bug when fetching unavailable content - Fix #482 - When opening a invalid/deleted/unavailable video, the popup was just printing the error, now it shows a message to the user and exits --- .../org/schabi/newpipe/player/PopupVideoPlayer.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java b/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java index 7d211ecdb..7d6345a8a 100644 --- a/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java +++ b/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java @@ -819,8 +819,15 @@ public class PopupVideoPlayer extends Service implements StateInterface { } }); } catch (Exception e) { - e.printStackTrace(); + if (DEBUG) e.printStackTrace(); + mainHandler.post(new Runnable() { + @Override + public void run() { + Toast.makeText(PopupVideoPlayer.this, R.string.content_not_available, Toast.LENGTH_SHORT).show(); + } + }); + stopSelf(); } } } -} \ No newline at end of file +}