fix options dialog crash

This commit is contained in:
Bnyro 2022-08-19 15:15:27 +02:00
parent b259bfb8b0
commit 7fea27b299

View File

@ -39,6 +39,7 @@ class VideoOptionsDialog(
/**
* Check whether the player is running by observing the notification
*/
try {
val notificationManager =
context?.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
notificationManager.activeNotifications.forEach {
@ -46,6 +47,9 @@ class VideoOptionsDialog(
optionsList += context?.getString(R.string.add_to_queue)
}
}
} catch (e: Exception) {
e.printStackTrace()
}
return MaterialAlertDialogBuilder(requireContext())
.setNegativeButton(R.string.cancel, null)