Android的短信通知 [英] Android sms notification

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

问题描述

我想删除通知,当短信来一般收件箱中。它是可能的...如果是的话又如何?我有很多的网站,是求佛,这是不可能通过code ...

i want to remove notification when SMS comes in general inbox. is it possible... if yes then how... i got many site where is metion this is not possible through code...

推荐答案

下面是正常的工作code本 AndroidManifest.xml中注册的接收器

Below is proper working code for this AndroidManifest.xml register for the receiver

<receiver android:name=".SmsFirst" android:exported="false">
            <intent-filter>
                <action android:name="android.provider.Telephony.SMS_RECEIVED" />
                </intent-filter>
</receiver>

public class SmsFirst extends BroadcastReceiver {

    private static final Object SMS_RECEIVED    = "android.provider.Telephony.SMS_RECEIVED";
    private static final String TAG          = "SMSBroadcastReceiver";

    @Override
    public void onReceive(Context context, Intent intent) {
        // TODO Auto-generated method stub

        Log.i(TAG, "Intent recieved: " + intent.getAction());

        if (intent.getAction().equals(SMS_RECEIVED)) {
            abortBroadcast();
                   }

这篇关于Android的短信通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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