diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 4e8ca0676..a7dcd9205 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -138,6 +138,7 @@ + @@ -195,6 +196,7 @@ + @@ -238,4 +240,4 @@ - \ No newline at end of file + diff --git a/app/src/main/java/org/schabi/newpipe/ChannelActivity.java b/app/src/main/java/org/schabi/newpipe/ChannelActivity.java index 37ef28a13..6258de152 100644 --- a/app/src/main/java/org/schabi/newpipe/ChannelActivity.java +++ b/app/src/main/java/org/schabi/newpipe/ChannelActivity.java @@ -147,6 +147,7 @@ public class ChannelActivity extends AppCompatActivity { serviceId = savedInstanceState.getInt(NavStack.SERVICE_ID); NavStack.getInstance() .restoreSavedInstanceState(savedInstanceState); + handleIntent(getIntent()); } } 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..e396ac1b6 100644 --- a/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java +++ b/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java @@ -60,6 +60,8 @@ import org.schabi.newpipe.player.popup.PopupViewHolder; import org.schabi.newpipe.player.popup.StateInterface; import org.schabi.newpipe.util.NavStack; +import java.io.IOException; + public class PopupVideoPlayer extends Service implements StateInterface { private static final String TAG = ".PopupVideoPlayer"; private static final boolean DEBUG = false; @@ -818,9 +820,25 @@ public class PopupVideoPlayer extends Service implements StateInterface { }); } }); + } catch (IOException ie) { + if (DEBUG) ie.printStackTrace(); + mainHandler.post(new Runnable() { + @Override + public void run() { + Toast.makeText(PopupVideoPlayer.this, R.string.network_error, Toast.LENGTH_SHORT).show(); + } + }); + stopSelf(); } 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 +}