mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-01-06 01:20:29 +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
|
* Check whether the player is running by observing the notification
|
||||||
*/
|
*/
|
||||||
val notificationManager =
|
try {
|
||||||
context?.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
|
val notificationManager =
|
||||||
notificationManager.activeNotifications.forEach {
|
context?.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
|
||||||
if (it.id == PLAYER_NOTIFICATION_ID) {
|
notificationManager.activeNotifications.forEach {
|
||||||
optionsList += context?.getString(R.string.add_to_queue)
|
if (it.id == PLAYER_NOTIFICATION_ID) {
|
||||||
|
optionsList += context?.getString(R.string.add_to_queue)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
e.printStackTrace()
|
||||||
}
|
}
|
||||||
|
|
||||||
return MaterialAlertDialogBuilder(requireContext())
|
return MaterialAlertDialogBuilder(requireContext())
|
||||||
|
Loading…
Reference in New Issue
Block a user