mirror of
https://github.com/SimpleMobileTools/Simple-Clock.git
synced 2025-01-31 10:44:52 +01:00
catch exceptions thrown at setting up mediaplayer
This commit is contained in:
parent
d8c9b34cc5
commit
2dba635e2f
@ -146,13 +146,17 @@ class ReminderActivity : SimpleActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
val soundUri = Uri.parse(if (alarm != null) alarm!!.soundUri else config.timerSoundUri)
|
val soundUri = Uri.parse(if (alarm != null) alarm!!.soundUri else config.timerSoundUri)
|
||||||
mediaPlayer = MediaPlayer().apply {
|
try {
|
||||||
setAudioStreamType(AudioManager.STREAM_ALARM)
|
mediaPlayer = MediaPlayer().apply {
|
||||||
setDataSource(this@ReminderActivity, soundUri)
|
setAudioStreamType(AudioManager.STREAM_ALARM)
|
||||||
setVolume(lastVolumeValue, lastVolumeValue)
|
setDataSource(this@ReminderActivity, soundUri)
|
||||||
isLooping = true
|
setVolume(lastVolumeValue, lastVolumeValue)
|
||||||
prepare()
|
isLooping = true
|
||||||
start()
|
prepare()
|
||||||
|
start()
|
||||||
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
showErrorToast(e)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.increaseVolumeGradually) {
|
if (config.increaseVolumeGradually) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user