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
This commit is contained in:
Stypox 2022-12-31 19:31:24 +01:00
parent 0923594e51
commit b3bfec9505
No known key found for this signature in database
GPG Key ID: 4BDF1B40A49FDD23
1 changed files with 3 additions and 5 deletions

View File

@ -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;
}