mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2024-12-23 00:20:32 +00:00
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:
parent
0923594e51
commit
b3bfec9505
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user