Adapter getItemId - top ranked examples from Open Source projects

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

This code example shows how to use the following methods:getItemId
  public Object getItem(int position) {
    return(delegate.getItem(position));
  } 
   
  public long getItemId(int position) {
    return(delegate.getItemId(position));
  } 
   
  public View getView(int position, View convertView,
                      ViewGroup parent) {
    return(delegate.getView(position, convertView, parent));
  } 
   
  public void registerDataSetObserver(DataSetObserver observer) {
    delegate.registerDataSetObserver(observer);
  } 
   
  public boolean hasStableIds() { 
    return(delegate.hasStableIds());
  } 
7
CodeRank
This code example shows how to use the following methods:getItemId
		return wrapped.getItem(i);
	} 
 
	@Override 
	public long getItemId(int i) {
		return wrapped.getItemId(i);
	} 
 
	@Override 
	public boolean hasStableIds() { 
		return wrapped.hasStableIds();
	} 
 
	@Override 
	public View getView(int position, View view, ViewGroup viewGroup) {
		return wrapped.getView(position, view, viewGroup);
	} 
 
	@Override 
	public int getItemViewType(int i) {
6
CodeRank
This code example shows how to use the following methods:getItemId
        return mDelegate.getItem(position);
    } 
 
    @Override 
    public long getItemId(int position) {
        return mDelegate.getItemId(position);
    } 
 
    @Override 
    public View getView(int position, View convertView, ViewGroup parent) {
        return mDelegate.getView(position, convertView, parent);
    } 
 
    @Override 
    public int getCountForHeader(int header) {
        return 0; 
    } 
 
    @Override 
    public int getNumHeaders() { 
6
CodeRank
This code example shows how to use the following methods:getItemId
 
			if (mDownTouchPosition >= 0) {
				if (mShouldCallbackOnUnselectedItemClick
						|| mDownTouchPosition == mSelectedPosition) {
					performItemClick(mDownTouchView, mDownTouchPosition,
							mAdapter.getItemId(mDownTouchPosition));
				} 
 
			} 
 
		} catch (Exception e1) {
			// TODO Auto-generated catch block 
			e1.printStackTrace();
		} 
 
		return false; 
 
	} 
	// public void onShowPress(MotionEvent e) { 
	// System.out.println("onShowPress..."); 
5
CodeRank
This code example shows how to use the following methods:getCount, getItemId
			return this;
		} 
	} 
 
	public long getItemId(int position) {
		if (position < baseAdapter.getCount()) {
			return baseAdapter.getItemId(position);
		} else { 
			if (isLoadingMore) return LOADING_ITEM_ID;
			return LOAD_MORE_ITEM_ID;
		} 
	} 
 
	protected int loadMoreViewType() { 
		return (baseAdapter.getViewTypeCount() - 1) + 1;
	} 
	 
	protected int loadingViewType() { 
		return (baseAdapter.getViewTypeCount() - 1) + 2;
	}	 
5
CodeRank
This code example shows how to use the following methods:getItemId
		 
		@Override 
		public boolean onLongClick(View v)
		{ 
			mContextMenuInfo = new AdapterView.AdapterContextMenuInfo(v,
					mPosition, mAdapter.getItemId(mPosition));
			mView.showContextMenuForChild(mView);
			return true; 
		} 
	} 
	 
	public TableLayoutView(Context context)
	{ 
		super(context);
		mContext = context;
		init(null); 
	} 
	 
	public TableLayoutView(Context context, AttributeSet attrs)
	{ 
3
CodeRank
This code example shows how to use the following methods:getItemId
            return wrapped.getItem(position);
        } 
 
        @Override 
        public long getItemId(int position) {
            return wrapped.getItemId(position);
        } 
 
        @Override 
        public int getItemViewType(int position) {
            return wrapped.getItemViewType(position);
        } 
 
        @Override 
        public View getView(int position, View convertView, ViewGroup parent) {
            return onPrepareView(wrapped.getView(position, convertView, parent), position);
        } 
 
        @Override 
        public int getViewTypeCount() { 
3
CodeRank
This code example shows how to use the following methods:getItemId
            checkedItemCount += value ? 1 : -1;
            if (actionMode != null) {
                ListAdapter adapter = getAdapter();
                if (adapter != null) {
                    choiceModeListener.onItemCheckedStateChanged(actionMode,
                            position, adapter.getItemId(position), value);
                } 
            } 
            requestLayout();
            invalidate();
        } else { 
            super.setItemChecked(position, value);
        } 
    } 
 
    public void setMultiChoiceModeListener(MultiChoiceModeListener listener) {
        choiceModeListener.setWrapped(listener);
    } 
 
    @Override 
3
CodeRank
This code example shows how to use the following methods:getItemId
		} 
		public Object getItem(int position) {
			return adapter.getItem(position);
		} 
		public long getItemId(int position) {
			return adapter.getItemId(position);
		} 
	} 
} 
4
CodeRank
This code example shows how to use the following methods:getItemId
 
	public long getItemId(int position) {
		if (position == 0)
			return -1; 
		else 
			return this.contentAdapter.getItemId(position-1);
	} 
 
	public int getItemViewType(int position) {
		if (position == 0)
			return 0; 
		else 
			return 1+this.contentAdapter.getItemViewType(position-1);
	} 
 
	public View getView(int position, View convertView, ViewGroup parent) {
		if (position == 0)
			return this.titleView;
		else 
			return this.contentAdapter.getView(position-1, convertView, parent);
4
CodeRank

Related Adapter getItemId Questions & Answers:

getItemId Method Overview
Get the row id associated with the specified position in the list.
See Code Examples for other Android Adapter Methods: