Android中如何检测彩信完全下载?

发布于 2024-11-24 18:28:17 字数 430 浏览 0 评论 0原文

我想实现一个在彩信完全下载后触发的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

栀子花开つ 2024-12-01 18:28:17

我想通了——至少是一个适合我的解决方案。

我创建了一个 ContentObserver (当我问这个问题时我并不知道它的存在),它监听 URI content://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 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文