From 2271ea4281ef1e05e08593e3d9e1314f09a2428d Mon Sep 17 00:00:00 2001 From: litetex <40789489+litetex@users.noreply.github.com> Date: Fri, 15 Oct 2021 20:16:34 +0200 Subject: [PATCH] Improved documentation --- .../java/org/schabi/newpipe/QueueItemMenuUtil.java | 3 +++ .../org/schabi/newpipe/util/NavigationHelper.java | 14 +++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/QueueItemMenuUtil.java b/app/src/main/java/org/schabi/newpipe/QueueItemMenuUtil.java index f2f71730d..7d00d0027 100644 --- a/app/src/main/java/org/schabi/newpipe/QueueItemMenuUtil.java +++ b/app/src/main/java/org/schabi/newpipe/QueueItemMenuUtil.java @@ -56,6 +56,9 @@ public final class QueueItemMenuUtil { .show(fragmentManager, "QueueItemMenuUtil@append_playlist")); return true; case R.id.menu_item_channel_details: + // An intent must be used here. + // Opening with FragmentManager transactions is not working, + // as PlayQueueActivity doesn't use fragments. NavigationHelper.openChannelFragmentUsingIntent(context, item.getServiceId(), item.getUploaderUrl(), item.getUploader()); return true; diff --git a/app/src/main/java/org/schabi/newpipe/util/NavigationHelper.java b/app/src/main/java/org/schabi/newpipe/util/NavigationHelper.java index 9e6a3980c..c70f6a9d0 100644 --- a/app/src/main/java/org/schabi/newpipe/util/NavigationHelper.java +++ b/app/src/main/java/org/schabi/newpipe/util/NavigationHelper.java @@ -491,11 +491,15 @@ public final class NavigationHelper { context.startActivity(intent); } - ///////////////////////////////////////////////////// - // PlayQueueActivity doesn't use fragments so the // - // openChannelFragment method can't be used // - // since that uses FragmentManager transactions. // - ///////////////////////////////////////////////////// + /** + * Opens {@link ChannelFragment}. + * Use this instead of {@link #openChannelFragment(FragmentManager, int, String, String)} + * when no fragments are used / no FragmentManager is available. + * @param context + * @param serviceId + * @param url + * @param title + */ public static void openChannelFragmentUsingIntent(final Context context, final int serviceId, final String url,