Android系统。错误。重新启动后弹出短信通知 [英] Android. Error. Pop SMS notification after reboot

查看:105
本文介绍了Android系统。错误。重新启动后弹出短信通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有问题。安装我的应用程序后,短信广播的拦截成功。但重新启动后,所有的拦截短信广播仍然弹出的通知栏(从标准SMS应用)

I have problem. After my application is installed, SMS broadcast is intercepted successfully . But after reboot, all intercepted SMS broadcast still popup in Notification Bar (from Standard Sms application)

广播接收器:

public class OwnSmsBroadcastextends BroadcastReceiver{
private static final String SMS_RECEIVED = "android.provider.Telephony.SMS_RECEIVED";
public void onReceive(Context context, Intent intent) {

        final Bundle bundle = intent.getExtras();
        if (intent.getAction().equals(SMS_RECEIVED)) {
            abortBroadcast();

        try {...

清单:

   <receiver android:name=".OwnSmsBroadcast"  android:permission="android.permission.BROADCAST_SMS">
            <intent-filter android:priority="10000">
                <action android:name="android.provider.Telephony.SMS_RECEIVED" />
                <action android:name="android.provider.Telephony.SMS_DELIVERED" />
                <action android:name="android.intent.action.BOOT_COMPLETED" /> 
            </intent-filter>
   </receiver>

为什么重启后所有截获notofications弹出?

Why after reboot all intercepted notofications popups?

推荐答案

谷歌视频群聊2.0的原因问题SMS_RECEIVED意图。这样做的目的过滤器设置为MAX_INTEGER价值2,147,483,647 - 超过您10,000价值。该文件说,应该优先不超过1000(最高值,你应该将其设置为为999)及以上,这将导致非predictable行为 - 尽管,通常优先级越高是Android的使用顺序。

Google Hangouts 2.0 causes problems with SMS_RECEIVED intents. The intent filter is set to the MAX_INTEGER value 2,147,483,647 - which exceeds your value of 10,000. The documentation says that PRIORITY should never exceed 1,000 (the highest value you should set it at is 999) and above that will result in "unpredictable behavior" - although, usually the higher the priority is the order used by Android.

要修复这个视频群聊或者禁用短信或卸载它。

To fix this either disable SMS in Hangouts or uninstall it.

仅供参考 - SMS_DELIVERED是无效的,直到奇巧(V4.4 +),但只有默认的短信应用将得到它。因此,它是没有必要,除非你还实施,以便默认的短信应用等几个特点。在奇巧,SMS_RECEIVED仍在播出,所以你将会收到通知,但你不能放弃它。

FYI - SMS_DELIVERED is not valid until KitKat (v4.4+) but only the default SMS app will receive it. So it is not necessary unless you also implement several other features in order to be the default SMS app. In KitKat, SMS_RECEIVED is still broadcast so you will be notified, but you cannot abort it.

这篇关于Android系统。错误。重新启动后弹出短信通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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