Android 发送短信的意图是什么? [英] What is the Android sent sms intent?

查看:25
本文介绍了Android 发送短信的意图是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿!我想知道 android 在发送消息时发送的意图是什么.我如何在我的应用程序中监听这个意图.我想要这样,当我在原生 android 消息传递中发送消息时,我的应用程序会侦听此意图,因此它会知道已发送一条新消息.

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

谢谢.

解决方案

我相信意图是:

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 不可用>

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.

解决方案

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

这篇关于Android 发送短信的意图是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆