Search code examples
androidnotificationsbroadcastreceiver

Are there any broadcast receivers to be able to tell when messages have been read?


I've written a program which uses Broadcast receivers to identify when certain events happen - e.g. new SMS/MMS message, missed call and new gmails.

When the broadcast receivers are triggered I'm setting variables to store the new states that have happened. What I'm looking for is a way to be able to change the setting upon the user seeing these messages - i.e. viewing the SMS, reading the e-mail or viewing the call log - or once they've clicked on the notification. Are there any broadcast receivers to be able to do this, or is there another way?

I ideally want to avoid having to poll for these changes and want to reflect the changes when they happen. Even if polling I'm not sure what I'd look for to see when a user had viewed the call log - for the others I can see how I could use the content provider to handle them.


Solution

  • if i remember well , registerContentObserver(Uri.parse("content://mms-sms"),true,m_MMSObserver) return something every time something is modified in the database (either adding line or modifying a line) , it should do the trick