如何执行的Andr​​oid在接收时的动作和短信? [英] How to perform an action in Android when receiving and SMS?

查看:118
本文介绍了如何执行的Andr​​oid在接收时的动作和短信?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有人可以帮助我弄清楚如何收到短信时执行的操作,是有它特殊的方法?它会自动在后台运行?我唯一​​知道的是,我需要使用许可,许可权。

Can someone please help me figure out how to perform an action when sms is received, is there a special method for it? Will it automatically be ran in the background? The only thing I know is that I need to use permission RECEIVE_SMS.

推荐答案

您将需要使用广播接收器的IntentFilter 。检查出来,在SDK参考。

You will need to use a BroadcastReceiver and an IntentFilter. Check them out in the SDK reference.

如果您注册一个的IntentFilter 的Andr​​oidManifest.xml 您注册的广播接收器那么它会被你的广播接收器在后台采摘。看看意图并提供了行动。

If you register an IntentFilter in the AndroidManifest.xml with your registration of the BroadcastReceiver then it will be picked by your BroadcastReceiver in the background. Look at Intent and the actions provided.

这篇关于如何执行的Andr​​oid在接收时的动作和短信?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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