Android: SMS monitoring for remote streams

I have currently written an application that monitors the contents: // sms URI for any changes to the database. My observer starts successfully when individual messages are added or deleted, however, the notification does not start when the entire thread is deleted immediately. Is there any way to trigger this event? Or maybe there is another content provider that I should watch?

Uri URI = Uri.parse("content://sms"); String[] columns = {"_id", "date"}; Cursor c = getContentResolver().query(URI, columns, "type=?", new String[]{"1"}, "_id DESC"); Observer observer = new Observer(); c.registerContentObserver(observer); 

And my observer class:

 private class Observer extends ContentObserver { public Observer() { super(null); } @Override public void onChange(boolean selfChange) { super.onChange(selfChange); if (!selfChange) { // do stuff // never called when a thread is deleted } } } 
+4
source share
1 answer

I switched to monitoring content content: // mms-sms / conversations. This provider correctly signals my supervisor when the thread is deleted.

+4
source

All Articles