mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-14 14:20:30 +05:30
fix options dialog crash
This commit is contained in:
parent
b259bfb8b0
commit
7fea27b299
@ -39,12 +39,16 @@ class VideoOptionsDialog(
|
||||
/**
|
||||
* Check whether the player is running by observing the notification
|
||||
*/
|
||||
val notificationManager =
|
||||
context?.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
|
||||
notificationManager.activeNotifications.forEach {
|
||||
if (it.id == PLAYER_NOTIFICATION_ID) {
|
||||
optionsList += context?.getString(R.string.add_to_queue)
|
||||
try {
|
||||
val notificationManager =
|
||||
context?.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
|
||||
notificationManager.activeNotifications.forEach {
|
||||
if (it.id == PLAYER_NOTIFICATION_ID) {
|
||||
optionsList += context?.getString(R.string.add_to_queue)
|
||||
}
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
|
||||
return MaterialAlertDialogBuilder(requireContext())
|
||||
|
Loading…
Reference in New Issue
Block a user