Skip to content Skip to sidebar Skip to footer

Android Send Sms Pending Intent

I'm using the following code to send SMS in my android app: PendingIntent pending = PendingIntent.getBroadcast(activity, 0, new Intent(PENDING), 0); activity.registerReceiv

Solution 1:

My question is when I get RESULT_OK, how can I know the _id column of the cursor adapter?

You can put a ContentObserver on the SMS Provider in order to receive a callback when the message gets written, and then query the Provider to get the message ID. I've an example of how to do that in my answer here. You would just need to change "thread_id" to "_id".

I can check for the _id later but is there a way to get it from the pendingIntent?

Unfortunately, no. That Intent is not going to carry much information beyond the result code. It might have a few extras attached - e.g., the SIM slot number - but it won't have the ID assigned by the SMS ContentProvider.

I'm not getting any callback on the deliveryIntent after delivery.

That's not unusual. The delivery PendingIntent will only fire if confirmation is received from the service center, but not every wireless provider offers that functionality.

Post a Comment for "Android Send Sms Pending Intent"