Skip to content

Commit

Permalink
Merge pull request #148 from simondankelmann/simondankelmann/foregrou…
Browse files Browse the repository at this point in the history
…ndservice

added nullcheck
  • Loading branch information
simondankelmann authored Dec 3, 2023
2 parents d685a7c + fce352b commit f9769ec
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 1 deletion.
Binary file modified app/debug/app-debug.apk
Binary file not shown.
Binary file modified app/release/app-release.apk
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class AdvertisementForegroundService: IAdvertisementServiceCallback, IAdvertisem


private fun createNotificationChannel() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && AppContext.getActivity() != null) {
val notificationManager = AppContext.getActivity().getSystemService(NOTIFICATION_SERVICE) as NotificationManager
val mChannel = NotificationChannel(_channelId, _channelName, NotificationManager.IMPORTANCE_HIGH)
mChannel.description = _channelDescription
Expand Down

0 comments on commit f9769ec

Please sign in to comment.