Android AdapterView.OnItemClickListener - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android AdapterView.OnItemClickListener class.

This code example shows how to use the following methods:onItemClick
    public void onClick(View view) {
        if (enabled) {
            if (secondaryOnClickListener != null)
                secondaryOnClickListener.onClick(view);
            if (onItemClickListener != null)
                onItemClickListener.onItemClick(null,
                        getChildAt(getLastIndex()), getLastIndex(),
                        getLastIndex() / colCount);
        } 
    } 
 
    void toggleAddDelete(boolean delete) {
        int resid = R.drawable.ic_menu_add;
        int stringid = R.string.profiles_add;
        if (delete) {
            resid = R.drawable.ic_menu_delete_holo_dark;
            stringid = R.string.dialog_delete_title;
        } 
        TextView addDeleteTile = ((TextView) getChildAt(getChildCount() - 1).findViewById(R.id.tile_textview));
        addDeleteTile.setCompoundDrawablesRelativeWithIntrinsicBounds(0, resid, 0, 0);
6
CodeRank
This code example shows how to use the following methods:onItemClick
        if (actionMode != null) {
            actionMode.finish();
            return; 
        } 
        if (itemClickListener != null) {
            itemClickListener.onItemClick(adapterView, view, position, id);
        } 
    } 
 
    View getView(int position, View viewWithoutSelection) {
        if (itemIncludesCheckBox(viewWithoutSelection)) {
            initItemCheckbox(position, (ViewGroup)viewWithoutSelection);
        } 
        updateItemBackground(position, viewWithoutSelection);
        return viewWithoutSelection;
    } 
     
    private boolean itemIncludesCheckBox(View v) {
        if (itemIncludesCheckBox == null) {
            if (!(v instanceof ViewGroup)) {
5
CodeRank
This code example shows how to use the following methods:onItemClick
    	if (enabled)
    	{ 
    		if (secondaryOnClickListener != null)
    			secondaryOnClickListener.onClick(view);
    		if (onItemClickListener != null && getLastIndex() != -1)
    			onItemClickListener.onItemClick(null, getChildAt(getLastIndex()), getLastIndex(), getLastIndex() / colCount);
    	} 
    } 
    public boolean onLongClick(View view)
    { 
    	if (!enabled)
    		return false; 
        int index = getLastIndex();
        if (index != -1)
        { 
            dragged = index;
            animateDragged(); 
            return true; 
        } 
        return false; 
5
CodeRank
This code example shows how to use the following methods:onItemClick
    @Override 
    @SuppressWarnings("unchecked") 
    public void onClick(View v) {
        if (this.mOnItemClickListener != null) {
            String[] data = v.getTag().toString().split("[|]"); //$NON-NLS-1$
            this.mOnItemClickListener.onItemClick(
                    (AdapterView<TwoColumnsMenuListAdapter>)v.getParent().getParent(),
                    v, Integer.parseInt(data[0]), Long.parseLong(data[1]));
        } 
    } 
 
} 
5
CodeRank
This code example shows how to use the following methods:onItemClick
        if (mOnItemClickListener != null) {
            playSoundEffect(SoundEffectConstants.CLICK);
            if (view != null) {
                view.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_CLICKED);
            } 
            mOnItemClickListener.onItemClick(/*this*/null, view, position, id);
            return true; 
        } 
 
        return false; 
    } 
 
    /** 
     * Interface definition for a callback to be invoked when an item in this 
     * view has been clicked and held. 
     */ 
    public interface OnItemLongClickListener { 
        /** 
         * Callback method to be invoked when an item in this view has been 
         * clicked and held. 
5
CodeRank
This code example shows how to use the following methods:onItemClick
    public void onClick(View view) {
        if (enabled) {
            if (secondaryOnClickListener != null)
                secondaryOnClickListener.onClick(view);
            if (onItemClickListener != null)
                onItemClickListener.onItemClick(null,
                        getChildAt(getLastIndex()), getLastIndex(),
                        getLastIndex() / colCount);
        } 
    } 
 
    void toggleAddDelete(boolean delete) {
        int resid = R.drawable.ic_menu_add;
        int stringid = R.string.profiles_add;
        if (delete) {
            resid = R.drawable.ic_menu_delete_holo_dark;
            stringid = R.string.dialog_delete_title;
        } 
        TextView addDeleteTile = ((TextView) getChildAt(getChildCount() - 1).findViewById(R.id.qs_text));
        addDeleteTile.setCompoundDrawablesRelativeWithIntrinsicBounds(0, resid, 0, 0);
3
CodeRank
This code example shows how to use the following methods:onItemClick
    public void onClick(View view) {
        if (enabled) {
            if (secondaryOnClickListener != null)
                secondaryOnClickListener.onClick(view);
            if (onItemClickListener != null)
                onItemClickListener.onItemClick(null,
                        getChildAt(getLastIndex()), getLastIndex(),
                        getLastIndex() / colCount);
        } 
    } 
 
    void toggleAddDelete(boolean delete) {
        int resid = R.drawable.ic_menu_add;
        int stringid = R.string.profiles_add;
        if (delete) {
            resid = R.drawable.ic_menu_delete_holo_dark;
            stringid = R.string.dialog_delete_title;
        } 
        TextView addDeleteTile = ((TextView) getChildAt(getChildCount() - 1).findViewById(R.id.tile_textview));
        addDeleteTile.setCompoundDrawablesRelativeWithIntrinsicBounds(0, resid, 0, 0);
3
CodeRank
This code example shows how to use the following methods:onItemClick
    public void onClick(View view) {
        if (enabled) {
            if (secondaryOnClickListener != null)
                secondaryOnClickListener.onClick(view);
            if (onItemClickListener != null)
                onItemClickListener.onItemClick(null,
                        getChildAt(getLastIndex()), getLastIndex(),
                        getLastIndex() / colCount);
        } 
    } 
 
    void toggleAddDelete(boolean delete) {
        int resid = R.drawable.ic_menu_add;
        int stringid = R.string.profiles_add;
        if (delete) {
            resid = R.drawable.ic_menu_delete_holo_dark;
            stringid = R.string.dialog_delete_title;
        } 
        TextView addDeleteTile = ((TextView) getChildAt(getChildCount() - 1).findViewById(R.id.qs_text));
        addDeleteTile.setCompoundDrawablesRelativeWithIntrinsicBounds(0, resid, 0, 0);
4
CodeRank
This code example shows how to use the following methods:onItemClick
    	if (enabled)
    	{ 
    		if (secondaryOnClickListener != null)
    			secondaryOnClickListener.onClick(view);
    		if (onItemClickListener != null && getLastIndex() != -1)
    			onItemClickListener.onItemClick(null, getChildAt(getLastIndex()), getLastIndex(), getLastIndex() / colCount);
    	} 
    } 
    public boolean onLongClick(View view) {
    	if (!enabled)
    		return false; 
        int index = getLastIndex();
        if (index != -1)
        { 
            dragged = index;
            animateDragged(); 
            return true; 
        } 
        return false; 
    } 
5
CodeRank
This code example shows how to use the following methods:onItemClick
     * {@inheritDoc} 
     */ 
    @Override 
    public void onClick(View v) {
        ViewHolder viewHolder = (ViewHolder)v.getTag();
        this.mOnItemClickListener.onItemClick(null, v, viewHolder.mPosition, v.getId());
    } 
 
} 
4
CodeRank

Related Android AdapterView.OnItemClickListener Questions & Answers:

Other Android AdapterView.OnItemClickListener Examples

11:		 * */
12:		private class SlideMenuClickListener implements
13:				ListView.OnItemClickListener {
14:			@Override
15:			public void onItemClick(AdapterView<?> parent, View view, int position,

Read More

61:			// launching Edit Product Screen
62:			lv.setOnItemClickListener(new OnItemClickListener() {
63:	
64:				@Override
65:				public void onItemClick(AdapterView<?> parent, View view,

Read More

63:	        // Click event for single list row
64:	        list.setOnItemClickListener(new OnItemClickListener() {
65:	
66:				@Override
67:				public void onItemClick(AdapterView&lt;?&gt; parent, View view,

Read More

See Code Examples for Android AdapterView.OnItemClickListener Methods: