I'm trying to tally the number of outgoing SMSes sent by the user. Currently, my code goes like this:
class SentSMSObserver extends ContentObserver {
....
}
SentSMSObserver sso = new SentSMSObserver(new Handler());
ContentResolver cr = this.getContentResolver();
cr.registerContentObserver(Uri.parse("content://sms"), true, sso);
I tried to run the app in an emulator sporting Jelly Bean and for some reason, when I send a text message via the native SMS app, it increments my tally by three.
Now, I decided to replace content://sms
with content://sms/sent
as the related StackOverflow q&a's would suggest, but when I run the app with that setting, it never even executes my content observer's onChange()
. What do I do?