mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2025-09-26 14:34:03 +00:00
Add comment for fragment lifecycle checks before showing DownloadDialog
This commit is contained in:
@@ -113,6 +113,8 @@ public enum StreamDialogDefaultEntry {
|
||||
DOWNLOAD(R.string.download, (fragment, item) ->
|
||||
fetchStreamInfoAndSaveToDatabase(fragment.requireContext(), item.getServiceId(),
|
||||
item.getUrl(), info -> {
|
||||
// Ensure the fragment is attached and its state hasn't been saved to avoid
|
||||
// showing the dialog during lifecycle changes or when the activity is paused.
|
||||
if (fragment.isAdded() && !fragment.isStateSaved()) {
|
||||
final DownloadDialog downloadDialog =
|
||||
new DownloadDialog(fragment.requireContext(), info);
|
||||
|
Reference in New Issue
Block a user