I'm writing application which handles SMS's and as I plan it should replace stock/default application.
I'm intercepting android.provider.Telephony.SMS_RECEIVED
broadcast fired by incoming SMS and publishing my own notification and then calling abortBroadcast()
, so in the end there is no notification for incoming new messages which leads to default/stock app.
But the problem is in fact that when user doesn't read for a long enough time (smth like several minutes) incoming SMS stock/default app aroses another broadcast - I suspect just checking that there's unread sms. So user sees 2 notifications: one from default/stock messaging app and another one from mines, which is messing.
I can't find which broadcast fired when there's unread sms?
Any ideas, hints?
You can set the priority of your receiver this way, so you know that it has the top priority and will execute the
onReceive()
method: