gpt4 book ai didi

android - kitkat 4.4 中的 Java block 传入短信

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:02:37 24 4
gpt4 key购买 nike

我正在开发一个 android 应用程序,它将阻止来自特定号码的传入短信我已经成功实现了这一点。该应用程序在除版本 4.4.4 之外的其他版本中运行良好。我已经设定了它的优先级,但对我没有任何用处。这是 list 中接收器的代码

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

我通过在java中调用这个方法来阻止短信

this.abortBroadcast();

我搜索以解决此问题,发现在 kitkat 中,该应用程序需要设置为默认消息传递应用程序才能中止消息。但我想以编程方式执行此操作。有没有办法以编程方式阻止 kitkat 中的传入短信???

最佳答案

I search to solve this problem and found that in kitkat the app need to set as default messaging app to abort the msg

API 级别 19 及更高级别就是这种情况。目前,即~60% of Android devices actively using the Play Store .

But i want to do this programatically

欢迎您要求用户将您的应用设为默认短信客户端,via an ACTION_CHANGE_DEFAULT Intent .除了某些安全漏洞外,您不能通过 Android SDK 强制您的应用成为默认的 SMS 客户端。

Is there any way to block incoming sms in kitkat programatically?

编写一个具有短信拦截功能的完整短信客户端。

关于android - kitkat 4.4 中的 Java block 传入短信,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32924021/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com