properly handle inserting and deleting threads from local db
This commit is contained in:
parent
2b3df2719b
commit
35c205605d
4 changed files with 40 additions and 13 deletions
|
|
@ -462,10 +462,12 @@ fun Context.insertNewSMS(address: String, subject: String, body: String, date: L
|
|||
return newUri?.lastPathSegment?.toInt() ?: 0
|
||||
}
|
||||
|
||||
fun Context.deleteConversation(id: Int) {
|
||||
fun Context.deleteConversation(threadId: Int) {
|
||||
conversationsDB.deleteThreadId(threadId.toLong())
|
||||
|
||||
var uri = Sms.CONTENT_URI
|
||||
val selection = "${Sms.THREAD_ID} = ?"
|
||||
val selectionArgs = arrayOf(id.toString())
|
||||
val selectionArgs = arrayOf(threadId.toString())
|
||||
contentResolver.delete(uri, selection, selectionArgs)
|
||||
|
||||
uri = Mms.CONTENT_URI
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue