这就是我将我的应用程序意图过滤器的优先级设置为最高的方式。在接收到额外的意图后,我中止了广播,但本机应用程序仍在接收短信,并且通知栏仍然显示最烦人的消息内容,因为我没有希望它显示消息正文。有什么我想念的吗?
<receiver android:name=".MySmsReceiver" >
<intent-filter>
<action android:name="android.provider.Telephony.SMS_RECEIVED"
android:priority="999"
/>
</intent-filter>
</receiver>
这是我的接收者的onReceive()
方法
public void onReceive(final Context context, Intent intent) {
Bundle extras = intent.getExtras();
abortBroadcast();
....
}