I have a notification app, which is creating notification when sms message is received. Basically, I am listening to intent android.provider.Telephony.SMS_RECEIVED and when it is firing, I am getting Intent with sms message inside.
Then I am creating Notification with PendingIntent, in which I am setting extra URI with “sms:”. But I need to set URI with “sms:” + threadId.
The problem is: I can’t find the way to find ThreadId indide SmsMessage. Maybe some help?
threadIdis a concept within the SMS inbox and has nothing to do with the telephony’s SMS layer. You’ll have to play inside the undocumented SMS content provider to do what you’re trying to do. Search for “sms content provider” and there’s a variety of information about it. You’ll have to somehow correlate your received SMS with things in the inbox to be able to pull the correct threadId.