Cursor registerDataSetObserver - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Cursor registerDataSetObserver method.

This code example shows how to use the following methods:getColumnIndexOrThrow, registerContentObserver, registerDataSetObserver
            } 
        } 
        mCursor = newCursor;
        if (newCursor != null) {
            if (mChangeObserver != null) {
                newCursor.registerContentObserver(mChangeObserver);
            } 
            if (mDataSetObserver != null) {
                newCursor.registerDataSetObserver(mDataSetObserver);
            } 
            mRowIDColumn = newCursor.getColumnIndexOrThrow("_id");
            mDataValid = true;
            // notify the observers about the new cursor 
            notifyDataSetChanged(); 
        } else { 
            mRowIDColumn = -1;
            mDataValid = false;
            // notify the observers about the lack of a data set 
            notifyDataSetChanged(); 
        } 
7
CodeRank
This code example shows how to use the following methods:close, getColumnIndexOrThrow, registerContentObserver, registerDataSetObserver, unregisterContentObserver
This code example shows how to use the following methods:close, getCount, registerContentObserver, registerDataSetObserver, sleep
                long elapsed = (end - start);
                if (cursor == null) {
                    Log.d(TAG, mSrc + ": null cursor in " + formatTime(elapsed)
                            + " for '" + mQuery + "'");
                } else { 
                    Log.d(TAG, mSrc + ": " + cursor.getCount() + " rows in " + formatTime(elapsed)
                            + " for '" + mQuery + "'");
                    cursor.registerContentObserver(new ChangeObserver(cursor));
                    cursor.registerDataSetObserver(new MyDataSetObserver(mSrc, start, cursor));
                    try { 
                        Thread.sleep(2000);
                    } catch (InterruptedException ex) {
                        Log.d(TAG, mSrc + ": interrupted");
                    } 
                } 
            } finally { 
                if (cursor != null) {
                    cursor.close();
                } 
            } 

7
CodeRank
This code example shows how to use the following methods:registerDataSetObserver
    wrappedCursor.unregisterContentObserver(contentObserver);
  } 
 
  @Implementation 
  public void registerDataSetObserver(DataSetObserver dataSetObserver) {
    wrappedCursor.registerDataSetObserver(dataSetObserver);
  } 
 
  @Implementation 
  public void unregisterDataSetObserver(DataSetObserver dataSetObserver) {
    wrappedCursor.unregisterDataSetObserver(dataSetObserver);
  } 
 
  @Implementation 
  public void setNotificationUri(ContentResolver contentResolver, Uri uri) {
    wrappedCursor.setNotificationUri(contentResolver, uri);
  } 
 
  @Implementation 
  public boolean getWantsAllOnMoveCalls() { 
7
CodeRank
This code example shows how to use the following methods:registerDataSetObserver
        wrappedCursor.unregisterContentObserver(contentObserver);
    } 
 
    @Implementation 
    public void registerDataSetObserver(DataSetObserver dataSetObserver) {
        wrappedCursor.registerDataSetObserver(dataSetObserver);
    } 
 
    @Implementation 
    public void unregisterDataSetObserver(DataSetObserver dataSetObserver) {
        wrappedCursor.unregisterDataSetObserver(dataSetObserver);
    } 
 
    @Implementation 
    public void setNotificationUri(ContentResolver contentResolver, Uri uri) {
        wrappedCursor.setNotificationUri(contentResolver, uri);
    } 
 
    @Implementation 
    public boolean getWantsAllOnMoveCalls() { 
6
CodeRank
This code example shows how to use the following methods:getColumnIndexOrThrow, registerContentObserver, registerDataSetObserver
        mCursor = cursor;
        resetCache(); 
        findGroups(); 
 
        if (cursor != null) {
            cursor.registerContentObserver(mChangeObserver);
            cursor.registerDataSetObserver(mDataSetObserver);
            mRowIdColumnIndex = cursor.getColumnIndexOrThrow("_id");
            notifyDataSetChanged();
        } else { 
            // notify the observers about the lack of a data set 
            notifyDataSetInvalidated();
        } 
 
    } 
 
    public Cursor getCursor() {
        return mCursor;
    } 
 

6
CodeRank
This code example shows how to use the following methods:getColumnIndexOrThrow, registerContentObserver, registerDataSetObserver
        mCursor = cursor;
        resetCache(); 
        findGroups(); 
 
        if (cursor != null) {
            cursor.registerContentObserver(mChangeObserver);
            cursor.registerDataSetObserver(mDataSetObserver);
            mRowIdColumnIndex = cursor.getColumnIndexOrThrow("_id");
            notifyDataSetChanged();
        } else { 
            // notify the observers about the lack of a data set 
            notifyDataSetInvalidated();
        } 
 
    } 
 
    public Cursor getCursor() {
        return mCursor;
    } 
 

6
CodeRank
This code example shows how to use the following methods:registerDataSetObserver
	cursor.unregisterContentObserver(observer);
    } 
 
    @Implementation 
    public void registerDataSetObserver(DataSetObserver observer) {
	cursor.registerDataSetObserver(observer);
    } 
 
    @Implementation 
    public void unregisterDataSetObserver(DataSetObserver observer) {
	cursor.unregisterDataSetObserver(observer);
    } 
 
    @Implementation 
    public void setNotificationUri(ContentResolver cr, Uri uri) {
	cursor.setNotificationUri(cr, uri);
    } 
 
    @Implementation 
    public boolean getWantsAllOnMoveCalls() { 
5
CodeRank
This code example shows how to use the following methods:registerDataSetObserver
	/* (non-Javadoc) 
	 * @see android.database.Cursor#registerDataSetObserver(android.database.DataSetObserver) 
	 */ 
	@Override 
	public void registerDataSetObserver(DataSetObserver observer) {
		mCursor.registerDataSetObserver(observer);
	} 
 
	/* (non-Javadoc) 
	 * @see android.database.Cursor#requery() 
	 */ 
	@Override 
	public boolean requery() { 
		return mCursor.requery();
	} 
 
	/* (non-Javadoc) 
	 * @see android.database.Cursor#respond(android.os.Bundle) 
	 */ 
	@Override 
5
CodeRank
This code example shows how to use the following methods:registerDataSetObserver
        mCursor.unregisterContentObserver(observer);
    } 
 
    @Override 
    public void registerDataSetObserver(DataSetObserver observer) {
        mCursor.registerDataSetObserver(observer);
    } 
 
    @Override 
    public void unregisterDataSetObserver(DataSetObserver observer) {
        mCursor.unregisterDataSetObserver(observer);
    } 
} 
4
CodeRank

Related Cursor registerDataSetObserver Questions & Answers:

registerDataSetObserver Method Overview
Register an observer that is called when changes happen to the contents of the this cursors data set, for example, when the data set is changed via requery(), deactivate(), or close().
See Code Examples for other Android Cursor Methods: