中止 Android KitKat 上的 SMS Intent [英] Abort SMS Intent on Android KitKat

查看:54
本文介绍了中止 Android KitKat 上的 SMS Intent的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在开发一个应用程序,仅当它是应用程序预期的 SMS 时才需要处理 SMS(与注册时的 Whatsapp 行为相同).

I'm currently developing an application that needs to deal with SMS only if it is an SMS expected by the application (same behaviour as Whatsapp on registration).

我想中止 SMS Intent,因为它不会出现在 SMS 框中.

I would like to abort the SMS Intent as it is not expected to appear in the SMS box.

我的问题是:我知道 Google 在 KitKat 中改变了很多关于 SMS 行为,现在,即使我的 SMS 被我的应用程序很好地解析,SMS 也会出现在 SMSBox 中,即使我调用 this.abortBroadcast(); 在我的 SMS 广播接收器中.那么有没有一种方法可以避免那些短信出现在短信盒子里,而无需开发一个完整的短信应用程序?

My question is : I know that Google changed a lot about SMS behaviour in KitKat, and now, even if my SMS is well parsed by my application, the SMS also appear in SMSBox, even if I call this.abortBroadcast(); in my SMS broadcast receiver. So is there a way to avoid those SMS appearing in SMS box without having to develop a complete SMS application ?

有关信息,此广播接收器的清单文件中的优先级尚未达到 1000(我也尝试使用 MAX Integer).

For information, the priority is yet to 1000 (and I tried also with MAX Integer) in Manifest file for this Broadcast Receiver.

推荐答案

Hangouts 使用最大可能的优先级(每个 Intent-Filter 文档),因此您不能在 <4.4 版本上中止它.在 4.4+ 上,只有 默认短信应用(="http://android-developers.blogspot.com/2013/10/getting-your-sms-apps-ready-for-kitkat.html" rel="noreferrer">详细的博客文章) 可以更改 SMS Provider(即自动删除 SMS).

Hangouts uses the maximum possible priority (999 per the Intent-Filter docs) and therefore you cannot abort it on <4.4 releases. On 4.4+, only the default SMS app (blog post with details) can make changes to the SMS Provider (i.e., automatically delete the SMS).

这篇关于中止 Android KitKat 上的 SMS Intent的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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