Skip to content

Commit b3bfec9

Browse files
committed
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
1 parent 0923594 commit b3bfec9

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

app/src/main/java/org/schabi/newpipe/QueueItemMenuUtil.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import android.view.View;
99
import android.widget.PopupMenu;
1010

11-
import androidx.appcompat.app.AppCompatActivity;
1211
import androidx.fragment.app.FragmentManager;
1312

1413
import org.schabi.newpipe.database.stream.model.StreamEntity;
@@ -79,12 +78,11 @@ public static void openPopupMenu(final PlayQueue playQueue,
7978
item.getThumbnailUrl());
8079
return true;
8180
case R.id.menu_item_download:
82-
fetchStreamInfoAndSaveToDatabase(context, item.getServiceId(),
83-
item.getUrl(), info -> {
81+
fetchStreamInfoAndSaveToDatabase(context, item.getServiceId(), item.getUrl(),
82+
info -> {
8483
final DownloadDialog downloadDialog = new DownloadDialog(context,
8584
info);
86-
downloadDialog.show(((AppCompatActivity) context)
87-
.getSupportFragmentManager(), "downloadDialog");
85+
downloadDialog.show(fragmentManager, "downloadDialog");
8886
});
8987
return true;
9088
}

0 commit comments

Comments
 (0)