Cursor deactivate - 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 deactivate method.

This code example shows how to use the following methods:deactivate
    return wrappedCursor.isNull(i);
  } 
 
  @Implementation 
  public void deactivate() { 
    wrappedCursor.deactivate();
  } 
 
  @Implementation 
  public boolean requery() { 
    return wrappedCursor.requery();
  } 
 
  @Implementation 
  public void close() { 
    wrappedCursor.close();
  } 
 
  @Implementation 
  public boolean isClosed() { 
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:close, deactivate, moveToFirst
 
	public <T> T query(String sql, CursorDataExtractor<T> cursorDataExactor) {
		Cursor cursor = sqLiteDatabase.rawQuery(sql, null);
		T t = null;
		if (cursor != null ) {
			if(cursor.moveToFirst()){
				t = cursorDataExactor.extractData(sqLiteDatabase, cursor);
			} 
			cursor.deactivate();
			cursor.close();
		} 
		return t;
	} 
 
} 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:close, deactivate, getColumnIndex, getString, moveToFirst
		sql.append(" WHERE Config_Key = '").append(name).append("'");
 
		Cursor cursor = sqLiteDatabase.rawQuery(sql.toString(), null);
		String value = null;
		if (null != cursor ) {
			if(cursor.moveToFirst()){
				value = cursor.getString(cursor.getColumnIndex("Config_Value"));
			} 
			cursor.deactivate();
			cursor.close();
		} 
		return value;
	} 
 
	/** 
	 * 获取所有设置 
	 * 
	 * @return Hashtable 保存设置信息键值对的Hashtable 
	 */ 
	public Hashtable<String, String> getConfigKeyValueMap() {
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:deactivate
        return wrappedCursor.isNull(i);
    } 
 
    @Implementation 
    public void deactivate() { 
        wrappedCursor.deactivate();
    } 
 
    @Implementation 
    public boolean requery() { 
        return wrappedCursor.requery();
    } 
 
    @Implementation 
    public void close() { 
        wrappedCursor.close();
    } 
 
    @Implementation 
    public boolean isClosed() { 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:close, deactivate
            // IllegalStateException may be thrown if the cursor is stale. 
            Log.e(TAG, "Caught exception while deactivating cursor.", e);
        } 
        mContentResolver = null;
        if (mCursor != null) {
            mCursor.close();
            mCursor = null;
        } 
    } 
 
    // TODO: Change public to protected 
    public Uri contentUri(long id) {
        // TODO: avoid using exception for most cases 
        try { 
            // does our uri already have an id (single image query)? 
            // if so just return it 
            long existingId = ContentUris.parseId(mBaseUri);
            if (existingId != id) Log.e(TAG, "id mismatch");
            return mBaseUri;
        } catch (NumberFormatException ex) {

6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:close, deactivate, moveToFirst
 
	T query(SQLiteDatabase sqLiteDatabase , String sql) {
		T t = null;
		Cursor cursor = sqLiteDatabase.rawQuery(sql, null);
		if (cursor != null) {
			if (cursor.moveToFirst()) {
				t = extractData(sqLiteDatabase, cursor);
			} 
			cursor.deactivate();
			cursor.close();
			cursor = null;
		} 
		return t;
	} 
 
	/** 
	 * 检查参数是否为空 
	 * 
	 * @param account 
	 */ 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:close, deactivate
            // IllegalStateException may be thrown if the cursor is stale. 
            Log.e(TAG, "Caught exception while deactivating cursor.", e);
        } 
        mContentResolver = null;
        if (mCursor != null) {
            mCursor.close();
            mCursor = null;
        } 
    } 
 
    // TODO: Change public to protected 
    public Uri contentUri(long id) {
        // TODO: avoid using exception for most cases 
        try { 
            // does our uri already have an id (single image query)? 
            // if so just return it 
            long existingId = ContentUris.parseId(mBaseUri);
            if (existingId != id) Log.e(TAG, "id mismatch");
            return mBaseUri;
        } catch (NumberFormatException ex) {

6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:deactivate
        } 
 
        @Override 
        public void changeCursor(Cursor cursor) {
            if (mCursor != null && mCursor != cursor) {
                mCursor.deactivate();
            } 
            super.changeCursor(cursor);
        } 
 
        @Override 
        public Cursor runQueryOnBackgroundThread(CharSequence constraint) {
            mConstraints = constraint.toString();
 
            return ContactsPickerActivity.this.runQuery(constraint);
        } 
    } 
 
} 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:close, deactivate, unregisterContentObserver
	protected void finalize() { 
		if (debug)
			Log.d(TAG, "Finalize NotesListCursor");
 
		if (mDbCursor != null) {
			mDbCursor.unregisterContentObserver(mContentObserver);
			// mDbCursor.close(); 
			mDbCursor.deactivate();
			mDbCursor.close();
			mDbCursor = null;
		} 
 
		super.finalize(); 
	} 
 
} 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:close, deactivate
            // IllegalStateException may be thrown if the cursor is stale. 
            Log.e(TAG, "Caught exception while deactivating cursor.", e);
        } 
        mContentResolver = null;
        if (mCursor != null) {
            mCursor.close();
            mCursor = null;
        } 
    } 
 
    // TODO: Change public to protected 
    public Uri contentUri(long id) {
        // TODO: avoid using exception for most cases 
        try { 
            // does our uri already have an id (single image query)? 
            // if so just return it 
            long existingId = ContentUris.parseId(mBaseUri);
            if (existingId != id) Log.e(TAG, "id mismatch");
            return mBaseUri;
        } catch (NumberFormatException ex) {

5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java

Related Cursor deactivate Questions & Answers:

deactivate Method Overview
This method was deprecated in API level 16. Since requery() is deprecated, so too is this.
See Code Examples for other Android Cursor Methods: