开发者

Inject new SMS event on Android

开发者 https://www.devze.com 2023-04-09 04:36 出处:网络
I’m working on an app for Android. Is it possible to inject an event, so the phone thinks It just revived 开发者_开发知识库a new SMS. So it gives you a notification and everything. Not just put the n

I’m working on an app for Android. Is it possible to inject an event, so the phone thinks It just revived 开发者_开发知识库a new SMS. So it gives you a notification and everything. Not just put the new sms in the inbox.

Still cant get this to work, im thinking something like:

Intent a = new Intent("android.provider.Telephony.SMS_RECEIVED");
a.putExtra("tlf", "123");
startActivity(a);

And then some :) Any one?


I think you should call an SMS_RECEIVED intent....

here's some more info how sms_received intent works http://davanum.wordpress.com/2007/12/15/android-listen-for-incoming-sms-messages/


To get SMS notification, use this link. "Check Receiving SMS Messages"

To abort messages in Android in Receiver class, set abortBroadcast() and in Manifest.xml, set below code in SMSReceiver:

<intent-filter android:priority="1000">
            <action android:name="android.provider.Telephony.SMS_RECEIVED"/>
</intent-filter>
0

精彩评论

暂无评论...
验证码 换一张
取 消