I am deleting an SMS from the inbox but I want to know: How can I delete it before it reaches the inbox?
/**
* Check priority
* @param activity
*/
public static void receiverPriority(Activity activity){
Intent smsRecvIntent = new Intent("android.provider.Telephony.SMS_RECEIVED");
List infos = activity.getPackageManager().queryBroadcastReceivers(smsRecvIntent, 0);
for (ResolveInfo info : infos) {
System.out.println("Receiver: " + info.activityInfo.name + ", priority=" + info.priority);
}
}
Check priority and set higher priority (in your manifest) than other receivers.