allow deleting threads from the main screen
This commit is contained in:
parent
560935b61e
commit
2a319f9550
3 changed files with 56 additions and 2 deletions
|
|
@ -175,6 +175,13 @@ fun Context.insertNewSMS(address: String, subject: String, body: String, date: L
|
|||
contentResolver.insert(uri, contentValues)
|
||||
}
|
||||
|
||||
fun Context.deleteThread(id: Int) {
|
||||
val uri = Telephony.Sms.CONTENT_URI
|
||||
val selection = "${Telephony.Sms.THREAD_ID} = ?"
|
||||
val selectionArgs = arrayOf(id.toString())
|
||||
contentResolver.delete(uri, selection, selectionArgs)
|
||||
}
|
||||
|
||||
fun Context.markSMSRead(id: Int) {
|
||||
val uri = Telephony.Sms.CONTENT_URI
|
||||
val contentValues = ContentValues().apply {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue