Cursor registerContentObserver - 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 registerContentObserver 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
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:close, getColumnIndexOrThrow, registerContentObserver, registerDataSetObserver, unregisterContentObserver
	public void changeCursor(Cursor cursor) {
        if (this.cursor == cursor) {
            return; 
        } 
        if (cursor != null) {
            cursor.unregisterContentObserver(changeObserver);
            cursor.unregisterDataSetObserver(dataSetObserver);
            cursor.close();
        } 
        this.cursor = cursor;
        if (cursor != null) {
            cursor.registerContentObserver(changeObserver);
            cursor.registerDataSetObserver(dataSetObserver);
            rowIDColumn = cursor.getColumnIndexOrThrow(idColumnName);
            dataValid = true;
            // notify the observers about the new cursor 
            notifyDataSetChanged();
        } else { 
            rowIDColumn = -1;
            dataValid = false;
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
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
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:registerContentObserver
    return wrappedCursor.isClosed();
  } 
 
  @Implementation 
  public void registerContentObserver(ContentObserver contentObserver) {
    wrappedCursor.registerContentObserver(contentObserver);
  } 
 
  @Implementation 
  public void unregisterContentObserver(ContentObserver contentObserver) {
    wrappedCursor.unregisterContentObserver(contentObserver);
  } 
 
  @Implementation 
  public void registerDataSetObserver(DataSetObserver dataSetObserver) {
    wrappedCursor.registerDataSetObserver(dataSetObserver);
  } 
 
  @Implementation 
  public void unregisterDataSetObserver(DataSetObserver dataSetObserver) {
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:registerContentObserver
        return wrappedCursor.isClosed();
    } 
 
    @Implementation 
    public void registerContentObserver(ContentObserver contentObserver) {
        wrappedCursor.registerContentObserver(contentObserver);
    } 
 
    @Implementation 
    public void unregisterContentObserver(ContentObserver contentObserver) {
        wrappedCursor.unregisterContentObserver(contentObserver);
    } 
 
    @Implementation 
    public void registerDataSetObserver(DataSetObserver dataSetObserver) {
        wrappedCursor.registerDataSetObserver(dataSetObserver);
    } 
 
    @Implementation 
    public void unregisterDataSetObserver(DataSetObserver dataSetObserver) {
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
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
Connect your IDE to all the code out there  Get Codota for Java
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
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getCount, registerContentObserver
e.printStackTrace();
        } 
        if (cursor != null) {
            // Ensure the cursor window is filled 
            cursor.getCount();
            registerContentObserver(cursor, mObserver);
        } 
        return cursor;
    } 
 
    /** 
     * Registers an observer to get notifications from the content provider 
     * when the cursor needs to be refreshed. 
     */ 
    void registerContentObserver(Cursor cursor, ContentObserver observer) {
        cursor.registerContentObserver(mObserver);
    } 
 
    /* Runs on the UI thread */ 

6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:registerContentObserver
	/** 
	 * Registers the content observer for the cursor.  
	 * @param cursor {@link Cursor} whose content is to be observed for changes 
	 */ 
	protected void registerContentObserver(Cursor cursor){
		cursor.registerContentObserver(mObserver);
	} 
	 
	@Override 
	public void deliverResult(Cursor data) {
		if (isReset()) {
			if (data != null) {
				onReleaseResources(data);
			} 
			return; 
		} 
 
		Cursor oldCursor = mCursor;
		mCursor = data;
 
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getCount, registerContentObserver
e.printStackTrace();
        } 
        if (cursor != null) {
            // Ensure the cursor window is filled 
            cursor.getCount();
            registerContentObserver(cursor, mObserver);
        } 
        return cursor;
    } 
 
    /** 
     * Registers an observer to get notifications from the content provider 
     * when the cursor needs to be refreshed. 
     */ 
    void registerContentObserver(Cursor cursor, ContentObserver observer) {
        cursor.registerContentObserver(mObserver);
    } 
 
    /* Runs on the UI thread */ 

6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java

Related Cursor registerContentObserver Questions & Answers:

registerContentObserver Method Overview
Register an observer that is called when changes happen to the content backing this cursor.
See Code Examples for other Android Cursor Methods: