Android中如何检测彩信完全下载?
我想实现一个在彩信完全下载后触发的 BroadcastReceiver。我已经知道 android.provider.Telephony.WAP_PUSH_RECEIVED
操作,但这是在收到消息的第一部分时触发的,而不是在消息完全下载时(即新消息指示器图标时)出现)。
经过一番挖掘,我在消息源代码中发现了一个名为 android.intent.action.TRANSACTION_COMPLETED_ACTION
的操作(/src/com/android/mms/transaction/TransactionService.java
)我认为是在下载彩信后使用的,但是当此操作发生时我的 BroadcastReceiver 似乎没有被调用,所以我不确定该操作是否只是没有广播或者发生了什么。
感谢您的任何建议!
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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想通了——至少是一个适合我的解决方案。
我创建了一个
ContentObserver
(当我问这个问题时我并不知道它的存在),它监听 URIcontent://mms-sms/
和子项变化。它在彩信接收过程中被多次调用,其中一次似乎是在彩信下载后发生。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 URIcontent://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.