我讀短信與像廣播接收器:GO短信和android.provider.Telephony.SMS_RECEIVED接收
if (intent.getAction().equals("android.provider.Telephony.SMS_RECEIVED")) {
...
}
,但現在我安裝go sms pro
和我的接收器永遠不會再次發射。爲什麼?即使我使用sms pro,我仍然可以開啓接收器嗎?
我讀短信與像廣播接收器:GO短信和android.provider.Telephony.SMS_RECEIVED接收
if (intent.getAction().equals("android.provider.Telephony.SMS_RECEIVED")) {
...
}
,但現在我安裝go sms pro
和我的接收器永遠不會再次發射。爲什麼?即使我使用sms pro,我仍然可以開啓接收器嗎?
在清單中,您聲明您的意圖偵聽器。地址:
<intent-filter android:priority="1000">
GoSMSPro具有更高的優先級,然後你的聽衆最有可能
GO短信已設置它這些線路的艙單SmsReceiver:
<receiver android:name=".smspopup.SmsReceiver" android:permission="android.permission.BROADCAST_SMS">
<intent-filter android:priority="2147483647">
<action android:name="android.provider.Telephony.SMS_RECEIVED" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter android:priority="2147483647">
<action android:name="android.provider.Telephony.GSM_SMS_RECEIVED" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.provider.Telephony.WAP_PUSH_RECEIVED" />
<data android:mimeType="application/vnd.wap.mms-message" />
</intent-filter>
<intent-filter>
<action android:name="com.android.mms.transaction.MESSAGE_SENT" />
</intent-filter>
</receiver>
所有這些意圖過濾器使其優先即使您的接收器的優先級設置爲2147483647,也會高於您的接收器。您可以通過以下方式查看所有應用程序的所有接收器的列表:
List<ResolveInfo> receivers = getPackageManager().queryBroadcastReceivers(new Intent("android.provider.Telephony.SMS_RECEIVED"), 0);
列表中的第一個接收者,比其他人收到短信