mirror of
https://github.com/SimpleMobileTools/Simple-Clock.git
synced 2024-12-14 01:04:50 +01:00
adding some crashfixes
This commit is contained in:
parent
b7fdedb939
commit
68d06c828a
@ -29,7 +29,10 @@ import com.simplemobiletools.clock.receivers.HideAlarmReceiver
|
||||
import com.simplemobiletools.clock.receivers.HideTimerReceiver
|
||||
import com.simplemobiletools.clock.services.SnoozeService
|
||||
import com.simplemobiletools.commons.extensions.*
|
||||
import com.simplemobiletools.commons.helpers.*
|
||||
import com.simplemobiletools.commons.helpers.DAY_MINUTES
|
||||
import com.simplemobiletools.commons.helpers.SILENT
|
||||
import com.simplemobiletools.commons.helpers.isMarshmallowPlus
|
||||
import com.simplemobiletools.commons.helpers.isOreoPlus
|
||||
import java.util.*
|
||||
import kotlin.math.pow
|
||||
|
||||
@ -241,7 +244,11 @@ fun Context.showAlarmNotification(alarm: Alarm) {
|
||||
val pendingIntent = getOpenAlarmTabIntent()
|
||||
val notification = getAlarmNotification(pendingIntent, alarm)
|
||||
val notificationManager = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
|
||||
notificationManager.notify(alarm.id, notification)
|
||||
try {
|
||||
notificationManager.notify(alarm.id, notification)
|
||||
} catch (e: Exception) {
|
||||
showErrorToast(e)
|
||||
}
|
||||
|
||||
if (alarm.days > 0) {
|
||||
scheduleNextAlarm(alarm, false)
|
||||
|
@ -117,7 +117,7 @@ class ClockFragment : Fragment() {
|
||||
}
|
||||
|
||||
private fun updateTimeZones() {
|
||||
val selectedTimeZones = requireContext().config.selectedTimeZones
|
||||
val selectedTimeZones = context?.config?.selectedTimeZones ?: return
|
||||
view.time_zones_list.beVisibleIf(selectedTimeZones.isNotEmpty())
|
||||
if (selectedTimeZones.isEmpty()) {
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user