我正在创建 SMS 应用程序并希望中止广播 () 以阻止短信转到默认短信应用程序。它在 Android 4.2 版本中工作正常但在 Android 6.0 中不工作
我已经设置了最高优先级。
<receiver android:name=".sms.ReceiveSMS" android:permission="android.permission.BROADCAST_SMS">
<intent-filter android:priority="2147483647">
<action android:name="android.provider.Telephony.SMS_RECEIVED" />
</intent-filter>
</receiver>
targetsdk = 4.2
最佳答案
您无法阻止默认短信应用在 Android 4.4+ 上接收消息。参见 the documentation和 this official blog post .
关于android - Android 6.0 中的 abortBroadcast(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42459079/