override fun onReceive(context: Context, intent: Intent) {
if (intent.action == Telephony.Sms.Intents.SMS_RECEIVED_ACTION) {
val messages = Telephony.Sms.Intents.getMessagesFromIntent(intent)
for (message in messages) {
val sender = message.originatingAddress
val body = message.messageBody
}
}
}
1条答案
按热度按时间332nm8kg1#
就像这样: