adding some crashfixes

This commit is contained in:
tibbi 2020-11-05 16:45:08 +01:00
parent d3abe3906d
commit 236ad77fce
2 changed files with 9 additions and 2 deletions

View File

@ -63,7 +63,11 @@ class RenameRecordingDialog(val activity: BaseSimpleActivity, val recording: Rec
put(Media.DISPLAY_NAME, newDisplayName)
}
activity.contentResolver.update(getAudioFileContentUri(recording.id.toLong()), values, null, null)
try {
activity.contentResolver.update(getAudioFileContentUri(recording.id.toLong()), values, null, null)
} catch (e: Exception) {
activity.showErrorToast(e)
}
}
private fun updateLegacyFilename(recording: Recording, newTitle: String) {

View File

@ -195,7 +195,10 @@ class RecorderService : Service() {
private fun getAmplitudeUpdateTask() = object : TimerTask() {
override fun run() {
if (recorder != null) {
EventBus.getDefault().post(Events.RecordingAmplitude(recorder!!.maxAmplitude))
try {
EventBus.getDefault().post(Events.RecordingAmplitude(recorder!!.maxAmplitude))
} catch (ignored: Exception) {
}
}
}
}