adding some crashfixes
This commit is contained in:
parent
521731ec2c
commit
64011e1083
|
@ -588,6 +588,8 @@ class ThreadActivity : SimpleActivity() {
|
|||
message.addMedia(byteArray, mimeType)
|
||||
} catch (e: Exception) {
|
||||
showErrorToast(e)
|
||||
} catch (e: Error) {
|
||||
toast(e.localizedMessage ?: getString(R.string.unknown_error_occurred))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -601,6 +603,8 @@ class ThreadActivity : SimpleActivity() {
|
|||
thread_attachments_wrapper.removeAllViews()
|
||||
} catch (e: Exception) {
|
||||
showErrorToast(e)
|
||||
} catch (e: Error) {
|
||||
toast(e.localizedMessage ?: getString(R.string.unknown_error_occurred))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -491,7 +491,11 @@ fun Context.deleteMessage(id: Int, isMMS: Boolean) {
|
|||
val uri = if (isMMS) Mms.CONTENT_URI else Sms.CONTENT_URI
|
||||
val selection = "${Sms._ID} = ?"
|
||||
val selectionArgs = arrayOf(id.toString())
|
||||
contentResolver.delete(uri, selection, selectionArgs)
|
||||
try {
|
||||
contentResolver.delete(uri, selection, selectionArgs)
|
||||
} catch (e: Exception) {
|
||||
showErrorToast(e)
|
||||
}
|
||||
}
|
||||
|
||||
fun Context.markMessageRead(id: Int, isMMS: Boolean) {
|
||||
|
|
Loading…
Reference in New Issue