Code example for Cursor

Methods: registerContentObserver

0
                    Browser.BookmarkColumns.FAVICON };
            String whereClause = Browser.BookmarkColumns.VISITS + " != 0";
            String orderBy = Browser.BookmarkColumns.VISITS + " DESC";
            mCursor = managedQuery(Browser.BOOKMARKS_URI, projection,
                    whereClause, null, orderBy);
            mCursor.registerContentObserver(new ChangeObserver());
        } 
 
        private class ChangeObserver extends ContentObserver {
            public ChangeObserver() { 
                super(new Handler());
            } 
 
            @Override 
            public boolean deliverSelfNotifications() { 
                return true; 
            } 
 
            @Override 
            public void onChange(boolean selfChange) {
                MyAdapter.this.refreshData();