Search code examples
androidmms

Detecting new MMS (Android 2.1)


I'd like to recognize arrival of new MMS msg (after it is downloaded to inbox). I am doing the following:

private MMSContentObserver mMmsCO;

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    h = new Handler();
    mMmsCO = new MMSContentObserver(h);
    getContentResolver().registerContentObserver (Uri.parse("content://mms"), true, mMmsCO);
}

where

    private class MMSContentObserver extends ContentObserver {

    public MMSContentObserver(Handler h) {
        super(h);
    }               

    @Override
    public boolean deliverSelfNotifications() {
        return false;
    }

    @Override
    public void onChange(boolean selfChange) {
        super.onChange(selfChange);
    }
}

However, onChange is not getting called. What am I missing? Thanks in advance.


Solution

  • The MMS content provider isn't part of the SDK but it can be used... a real answer here would be nice since all messaging apps use content://mms in some way or shape.

    Since google decided not to standardize MMS we are all have to test on every phone out there but we still need to be able to handle MMSs in our apps.