From b3bfec9505ac956883dd62cc5db410568ef1bb1b Mon Sep 17 00:00:00 2001 From: Stypox Date: Sat, 31 Dec 2022 19:31:24 +0100 Subject: [PATCH] Use correct fragment manager for download dialog Tapping download on the long-press menu of queue items when the queue is shown inside the player would crash otherwise --- .../main/java/org/schabi/newpipe/QueueItemMenuUtil.java | 8 +++----- 1 file changed, 3 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 66c19f86d..3255489b0 100644 --- a/app/src/main/java/org/schabi/newpipe/QueueItemMenuUtil.java +++ b/app/src/main/java/org/schabi/newpipe/QueueItemMenuUtil.java @@ -8,7 +8,6 @@ import android.view.ContextThemeWrapper; import android.view.View; import android.widget.PopupMenu; -import androidx.appcompat.app.AppCompatActivity; import androidx.fragment.app.FragmentManager; import org.schabi.newpipe.database.stream.model.StreamEntity; @@ -79,12 +78,11 @@ public final class QueueItemMenuUtil { item.getThumbnailUrl()); return true; case R.id.menu_item_download: - fetchStreamInfoAndSaveToDatabase(context, item.getServiceId(), - item.getUrl(), info -> { + fetchStreamInfoAndSaveToDatabase(context, item.getServiceId(), item.getUrl(), + info -> { final DownloadDialog downloadDialog = new DownloadDialog(context, info); - downloadDialog.show(((AppCompatActivity) context) - .getSupportFragmentManager(), "downloadDialog"); + downloadDialog.show(fragmentManager, "downloadDialog"); }); return true; }