问题描述
可能重复:
可以说我有,我想每推出我的手机收到一个特定的文字信息,例如关键字时间的应用程序。我能做到这一点,如果我的应用程序没有运行?有什么好办法呢?
Lets say i have an application i want to launch every time my phone receives a specific text message, a keyword for example. Can i do this if my application is not running? What' s a good way to do it?
我从来没有尝试这样做,我想运行一个手机上的应用程序,它会发送特定短信到另一部手机(迄今所做的),那么第二个电话会开始收到消息当应用程序(后检查消息,看它的关键字)。
I have never tried this before and i want to run an application on one phone which will send a specific text message to another phone (done so far), then the 2nd phone would start an application when the message is received (after checking the message to see if its the keyword).
推荐答案
您需要编写的有以下意图过滤器
You need to write a BroadcastReceiver with the following intent filter
<intent-filter>
<action android:name="android.provider.Telephony.SMS_RECEIVED" />
</intent-filter>
这篇关于如何使Android上推出具体收到的短信应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!