Adapter getItem - 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 getItem method.

This code example shows how to use the following methods:getItem
  public int getCount() { 
    return(delegate.getCount());
  } 
   
  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);
  } 
7
CodeRank
This code example shows how to use the following methods:getItem
		return wrapped.getCount();
	} 
 
	@Override 
	public Object getItem(int i) {
		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) {
6
CodeRank
This code example shows how to use the following methods:getItem
    } 
 
    public Object getItemAtPosition(int position) {
        T adapter = getAdapter();
        return adapter == null || position < 0 ? null : adapter
                .getItem(position);
    } 
 
    public long getItemIdAtPosition(int position) {
        T adapter = getAdapter();
        return adapter == null || position < 0 ? AdapterView.INVALID_ROW_ID
                : adapter.getItemId(position);
    } 
 
    public int getLastVisiblePosition() { 
        return mFirstPosition + getChildCount() - 1;
    } 
 
    public final OnItemClickListener getOnItemClickListener() { 
        return mOnItemClickListener;
6
CodeRank
This code example shows how to use the following methods:getItem
        return mDelegate.getCount();
    } 
 
    @Override 
    public Object getItem(int position) {
        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) {
6
CodeRank
This code example shows how to use the following methods:getItem
 
	public boolean onNavigationItemSelected(int position, long itemId) {
		try { 
			ListNavigationSelectedItem selectedItem = 
					(ListNavigationSelectedItem)Binder.getAttributeForView(getView(), "ListNavigationSelectedItem"); 
			selectedItem.set(mAdapter.getItem(position));
			 
			ListNavigationOnItemSelected onItemSelected = 
					(ListNavigationOnItemSelected)Binder.getAttributeForView(getView(), "ListNavigationOnItemSelected"); 
			onItemSelected.invokeCommand(getView(), position, itemId);
		} catch (Exception e) {
			e.printStackTrace();
		} 
		return false; 
	} 
} 
5
CodeRank
This code example shows how to use the following methods:getItem
     */ 
    public Object getSelectedItem() {
        T adapter = getAdapter();
        int selection = getSelectedItemPosition();
        if (adapter != null && adapter.getCount() > 0 && selection >= 0) {
            return adapter.getItem(selection);
        } else { 
            return null; 
        } 
    } 
 
    /** 
     * @return The number of items owned by the Adapter associated with this 
     *         AdapterView. (This is the number of data items, which may be 
     *         larger than the number of visible views.) 
     */ 
    @ViewDebug.CapturedViewProperty 
    public int getCount() { 
        return mItemCount;
    } 
5
CodeRank
This code example shows how to use the following methods:getItem
		public boolean onNavigationItemSelected( 
				int itemPosition, long itemId) {
			try { 
				ListNavigationSelectedItem selectedItem = 
						(ListNavigationSelectedItem)Binder.getAttributeForView(getView(), "listNavigationSelectedItem"); 
				selectedItem.set(mAdapter.getItem(itemPosition));
				 
				ListNavigationOnItemSelected onItemSelected = 
						(ListNavigationOnItemSelected)Binder.getAttributeForView(getView(), "listNavigationOnItemSelected"); 
				onItemSelected.invokeCommand(getView(), itemPosition, itemId);
			} catch (Exception e) {
				e.printStackTrace();
			} 
			return true; 
		} 
	} 
 
	public boolean onNavigationItemSelected(int position, long itemId) {
		try { 
			ListNavigationSelectedItem selectedItem = 
5
CodeRank
This code example shows how to use the following methods:getItem
	@Override 
	public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
		if (items == null)
			return; 
 
		String key = (String) adapter.getItem(arg2);
		if (key == null)
			return; 
 
		String uri = items.get(key);
		if (uri == null)
			return; 
 
		dismiss();
 
		MainActivity activity = ((MainActivity) getActivity());
		activity.loadUri(Uri.parse(uri));
	} 
 
	@Override 
5
CodeRank
This code example shows how to use the following methods:getItem
			initiators.add(TabNavigationAdapter.this);
			try { 
				TabNavigationSelectedItem item = ((TabNavigationSelectedItem)BinderV30
	            	.getAttributeForView(getView(), "tabNavigationSelectedItem")); 
				 
				item.set(mAdapter.getItem(pos), initiators);
	             
	            TabNavigationOnItemSelected selected = 
	            		(TabNavigationOnItemSelected)BinderV30 
	            			.getAttributeForView(getView(), "tabNavigationOnItemSelected"); 
	             
	            selected.invokeCommand(getView(), tab, ft);
            } catch (AttributeNotDefinedException e) {
	            e.printStackTrace();
            } 
        } 
 
		public void onTabUnselected(Tab tab, FragmentTransaction ft) {
	        // TODO Auto-generated method stub 
	         
5
CodeRank
This code example shows how to use the following methods:getCount, getItem
		if (canLoadMore || isLoadingMore) return baseAdapter.getCount() + 1;
		return baseAdapter.getCount();
	} 
 
	public Object getItem(int position) {
		if (position < baseAdapter.getCount()) {
			return baseAdapter.getItem(position);
		} else { 
			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;
		} 
	} 
5
CodeRank

Related Adapter getItem Questions & Answers:

getItem Method Overview
Get the data item associated with the specified position in the data set.
See Code Examples for other Android Adapter Methods: