I have a ContentObserver
which I have tested on android 4.x and it worked well. But when I tried it on android 2.x it doesn't work.
mContentObserver = new ContentObserver(new Handler()) {
@Override
public void onChange(boolean selfChange, Uri uri) {
if (CardDAO.MANAGEMENT_URI.equals(uri) || SubjectDAO.MANAGEMENT_URI.equals(uri)
|| LearningProgressDAO.MANAGEMENT_URI.equals(uri) || ActivationDAO.MANAGEMENT_URI.equals(uri)) {
onContentChanged();
}
}
};
It appeared that there is no such method
public void onChange(boolean selfChange, Uri uri)
in android 2.x . The solution is to use method which is in old APIpublic void onChange(boolean selfChange)
HERE is the difference between two versions
2.x:
4.x: