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

This code example shows how to use the following methods:getCount, getPosition, isAfterLast, isBeforeFirst, moveToFirst
		return cursor.getColumnName(column - 1);
	} 
 
	@Override 
    public int getColumnType(int column) throws SQLException {
        int oldPos = cursor.getPosition();
        boolean moved = false;
        if (cursor.isBeforeFirst() || cursor.isAfterLast()) {
            boolean resultSetEmpty = cursor.getCount() == 0 || cursor.isAfterLast();
            if (resultSetEmpty) {
                return Types.NULL;
            } 
            cursor.moveToFirst();
            moved = true;
        } 
        int nativeType = getType(cursor, column - 1);
        int type;
        switch (nativeType) {
        case 0: // Cursor.FIELD_TYPE_NULL: 
            type = Types.NULL;

7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getPosition
    return wrappedCursor.getCount();
  } 
 
  @Implementation 
  public int getPosition() { 
    return wrappedCursor.getPosition();
  } 
 
  @Implementation 
  public boolean move(int i) {
    return wrappedCursor.move(i);
  } 
 
  @Implementation 
  public boolean moveToPosition(int i) {
    return wrappedCursor.moveToPosition(i);
  } 
 
  @Implementation 
  public boolean moveToFirst() { 
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getLong, getPosition
        protected Cursor getChildrenCursor(Cursor groupCursor) {
            // Given the group, we return a cursor for all the children within that group  
 
            // Return a cursor that points to this contact's phone numbers 
            Uri.Builder builder = Contacts.CONTENT_URI.buildUpon();
            ContentUris.appendId(builder, groupCursor.getLong(GROUP_ID_COLUMN_INDEX));
            builder.appendEncodedPath(Contacts.Data.CONTENT_DIRECTORY);
            Uri phoneNumbersUri = builder.build();
 
            mQueryHandler.startQuery(TOKEN_CHILD, groupCursor.getPosition(), phoneNumbersUri, 
                    PHONE_NUMBER_PROJECTION, Phone.MIMETYPE + "=?", 
                    new String[] { Phone.CONTENT_ITEM_TYPE }, null);
 
            return null; 
        } 
    } 
 
    private QueryHandler mQueryHandler;
    private CursorTreeAdapter mAdapter;
 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getPosition
        return wrappedCursor.getCount();
    } 
 
    @Implementation 
    public int getPosition() { 
        return wrappedCursor.getPosition();
    } 
 
    @Implementation 
    public boolean move(int i) {
        return wrappedCursor.move(i);
    } 
 
    @Implementation 
    public boolean moveToPosition(int i) {
        return wrappedCursor.moveToPosition(i);
    } 
 
    @Implementation 
    public boolean moveToFirst() { 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getPosition, move
	 * @param newPosition 
	 */ 
	private void onMove(int oldPosition, int newPosition)
	{ 
		if (oldPosition != newPosition || mCurrentEntity == null){
			mCurrentEntity = new Entity(mTableName, mCursor);
		} 
	} 
	 
	/** 
	 * Devuelve la entidad en curso.  
	 *  
	 * @return 
	 */ 
	public Entity getEntity() 
	{ 
		return mCurrentEntity; 
	} 
 
	/** 

6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getPosition, moveToFirst
	 * @param newPosition 
	 */ 
	private void onMove(int oldPosition, int newPosition)
	{ 
		if (oldPosition != newPosition || mCurrentEntity == null){
			mCurrentEntity = new Entity(mTableName, mCursor);
		} 
	} 
	 
	/** 
	 * Devuelve la entidad en curso.  
	 *  
	 * @return 
	 */ 
	public Entity getEntity() 
	{ 
		return mCurrentEntity; 
	} 
 
	/** 

6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getPosition
        return newView(); 
    } 
 
    @Override 
    public void bindView(View view, Context context, Cursor cursor) {
        bindView(view, cursor.getPosition());
    } 
} 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getPosition, moveToPosition
    } 
 
	protected abstract void calculateSections(Context context, Cursor cursor);
	 
	public View newView(Context context, Cursor cursor, ViewGroup parent) {
		return getRowView(null, cursor.getPosition(), parent);
	} 
	 
	@Override 
	public View getView(int position, View convertView, ViewGroup parent) {
		 
		 
		int positionGauge = position;
		for (int i = 0; i<sections.size(); i++) {
			final Section section = sections.get(i);
			 
			if (positionGauge == 0) {
				return getHeaderView(section.caption, i, null, parent);
			} 
 

6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getPosition
    public int getPosition() { 
        if (mClosed) {
            throw new IllegalStateException("getPosition after close()");
        } 
        try { 
            return mCursor.getPosition();
        } catch (RuntimeException ex) {
            // all operations on cross-process cursors can throw random exceptions 
            Log.e(TAG, "getPosition() failed, ", ex);
            return -1; 
        } 
    } 
 
    public String getShortcutId() {
        return getStringOrNull(SearchManager.SUGGEST_COLUMN_SHORTCUT_ID);
    } 
 
    public String getSuggestionFormat() {
        return getStringOrNull(mFormatCol);
    } 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getPosition
 
	@Override 
	protected Cursor getChildrenCursor(Cursor groupCursor)
	{ 
		// the child cursor is no longer valid 
		mLoadedGroups.remove(groupCursor.getPosition());
		mLoaderManager.restartLoader(groupCursor.getPosition(), null, this);
		return null; 
	} 
 
 
	public void reloadGroup(int position)
	{ 
		// the child cursor is no longer valid 
		mLoadedGroups.remove(position);
		if (position < getGroupCount())
		{ 
			mLoaderManager.restartLoader(position, null, this);
		} 
	} 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java

Related Cursor getPosition Questions & Answers:

getPosition Method Overview
Returns the current position of the cursor in the row set.
See Code Examples for other Android Cursor Methods: