gpt4 book ai didi

Telephony.TextBasedSmsColumns 中的 Android 传递信息

转载 作者:行者123 更新时间:2023-11-29 22:58:47 29 4
gpt4 key购买 nike

如何检查消息是否已在短信内容提供程序中传送(Telephony.TextBasedSmsColumns 字段)

最佳答案

按状态字段

mCursor = contentResolver.query(Uri.parse("content://sms"),
arrayOf("body", "date", "type", "status"),
"address like ?",
arrayOf("%$id"),
"date asc")

val status = mCursor.getInt(3)
if (status == 0) {
Toast.makeText(this, "Deliverd", Toast.LENGTH_SHORT)
} else if (status == 32)
Toast.makeText(this, "Sent and waiting for delivery", Toast.LENGTH_SHORT)
} else if (status == 64) {
Toast.makeText(this, "Failed", Toast.LENGTH_SHORT)
}

Telephony.TextBasedSmsColumns - STATUS

关于Telephony.TextBasedSmsColumns 中的 Android 传递信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57172703/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com