mirror of
https://github.com/SimpleMobileTools/Simple-SMS-Messenger.git
synced 2025-02-17 04:00:35 +01:00
adding some crashfixes
This commit is contained in:
parent
521731ec2c
commit
64011e1083
@ -588,6 +588,8 @@ class ThreadActivity : SimpleActivity() {
|
|||||||
message.addMedia(byteArray, mimeType)
|
message.addMedia(byteArray, mimeType)
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
showErrorToast(e)
|
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()
|
thread_attachments_wrapper.removeAllViews()
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
showErrorToast(e)
|
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 uri = if (isMMS) Mms.CONTENT_URI else Sms.CONTENT_URI
|
||||||
val selection = "${Sms._ID} = ?"
|
val selection = "${Sms._ID} = ?"
|
||||||
val selectionArgs = arrayOf(id.toString())
|
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) {
|
fun Context.markMessageRead(id: Int, isMMS: Boolean) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user