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) put(Media.DISPLAY_NAME, newDisplayName)
} }
try {
activity.contentResolver.update(getAudioFileContentUri(recording.id.toLong()), values, null, null) activity.contentResolver.update(getAudioFileContentUri(recording.id.toLong()), values, null, null)
} catch (e: Exception) {
activity.showErrorToast(e)
}
} }
private fun updateLegacyFilename(recording: Recording, newTitle: String) { private fun updateLegacyFilename(recording: Recording, newTitle: String) {

View File

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