How to detect MMS fully downloaded in Android?

空扰寡人 提交于 2019-12-13 17:48:32

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!