问题
I want to implement a BroadcastReceiver that is triggered after a MMS is fully downloaded. I already know about the android.provider.Telephony.WAP_PUSH_RECEIVED
action but this is triggered when the first part of the message is received, not when the message is fully downloaded (which is when the new message indicator icon shows up).
After some digging, I found an action called android.intent.action.TRANSACTION_COMPLETED_ACTION
in the Messaging source code (/src/com/android/mms/transaction/TransactionService.java
) that I think is used after an MMS is downloaded, but my BroadcastReceiver doesn't seem to get called when this action happens, so I'm not sure if the action just isn't broadcasted or what's going on.
Thanks for any advice!
回答1:
I figured this out - at least a solution that works for me.
I've created a ContentObserver
(which I didn't know existed when I asked this question) that listens to the URI content://mms-sms/
and children for changes. It gets called several times in the MMS receiving process, one of which seems to occur after the MMS is downloaded.
来源:https://stackoverflow.com/questions/6726158/how-to-detect-mms-fully-downloaded-in-android