show 100 latest messages, not oldest

This commit is contained in:
tibbi 2020-05-03 21:22:05 +02:00
parent d5c9cd5cee
commit 23203620ef
2 changed files with 2 additions and 2 deletions

View File

@ -56,7 +56,7 @@ android {
}
dependencies {
implementation 'com.simplemobiletools:commons:5.27.0'
implementation 'com.simplemobiletools:commons:5.27.2'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta4'
implementation 'org.greenrobot:eventbus:3.2.0'
implementation 'com.klinkerapps:android-smsmms:5.2.6'

View File

@ -54,7 +54,7 @@ fun Context.getMessages(threadId: Int): ArrayList<Message> {
val selection = "${Sms.THREAD_ID} = ?"
val selectionArgs = arrayOf(threadId.toString())
val sortOrder = "${Sms._ID} LIMIT 100"
val sortOrder = "${Sms._ID} DESC LIMIT 100"
var messages = ArrayList<Message>()
queryCursor(uri, projection, selection, selectionArgs, sortOrder, showErrors = true) { cursor ->