Android 发送短信意图是什么?

发布于 2024-09-30 19:25:01 字数 148 浏览 1 评论 0原文

嘿!我想知道android发送消息时发送的意图是什么。我如何在我的应用程序中倾听这个意图。我希望,当我在本机 Android 消息传递中发送消息时,我的应用程序会监听此意图,因此它会知道已发送新消息。

那么,它是哪一个,以及如何倾听这一意图?

谢谢。

Hey! I'd like to know which is the intent android sends when it sends a message. And how can I listen for this intent in my application. I wanted that, when I send a message in native android messaging, my application listen this intent, so it will know a new message has been sent.

So, which one is it, and how to listen for this intent?

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

眸中客 2024-10-07 19:25:01

我相信意图是:

public static final String SMS_RECEIVED_ACTION = "android.provider.Telephony.SMS_SENT";

这个人有一篇关于如何构建 BroadcastReceiver 来做到这一点的文章。

http://mobiforge.com/developing/story/sms-messaging-android

但是,我快速搜索了 Android 文档,但找不到 android.provider.Telephony 类。最新版本的 Android 可能不再支持它。然而,它值得尝试。如果您可以回复评论,让我知道这个意图是否仍然有效,那就太棒了。不知道为什么它不在文档网站上。

这是关于监听短信接收事件的类似问题:

android.provider.Telephony.SMS_RECEIVED不可用

I believe the Intent is:

public static final String SMS_RECEIVED_ACTION = "android.provider.Telephony.SMS_SENT";

This guy had an article about how to build a BroadcastReceiver to do this.

http://mobiforge.com/developing/story/sms-messaging-android

However, I did a quick search through the Android documentation and couldn't find an android.provider.Telephony class. It may no longer be supported in the latest version of Android. However, its worth trying out. If you could respond back with a comment to let me know if this intent still works or not that'd be awesome. Not sure why it's not on the documentation site.

Here's a similar question about listening for sms received events:

android.provider.Telephony.SMS_RECEIVED not available

本王不退位尔等都是臣 2024-10-07 19:25:01

我想知道android发送消息时发送的意图是什么。

AFAIK,当 Android发送短信时,没有广播Intent。这可能是出于隐私原因以及其他原因。

I'd like to know which is the intent android sends when it sends a message.

AFAIK, there is no Intent that is broadcast when Android sends an SMS. This is probably for privacy reasons as much as anything else.

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