Java Code Examples for android.widget.AdapterView#setOnItemClickListener()
The following examples show how to use
android.widget.AdapterView#setOnItemClickListener() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BaseAdapterConverter.java From UniversalAdapter with Apache License 2.0 | 6 votes |
/** * Binds this adapter to the given {@link AdapterView}, setting it as its adapter. This should be done by * construction or immediately after, before this adapter is used. This mechanism sets this class as the view's * adapter and permits certain functionality such as click events. Without it, this class will still function as * a normal {@link BaseAdapter}, but additional functionality may not work. Ignore this step at your own risk. * * @param adapterView The {@link AdapterView} to bind to. */ public void bindToAdapterView(AdapterView<? super BaseAdapter> adapterView) { if (adapterView != null) { adapterView.setAdapter(this); // Spinners don't like on item click listeners. // We will still delegate calls to it since you're clicking on an item to select it... if (!(adapterView instanceof Spinner)) { adapterView.setOnItemClickListener(internalItemClickListener); } else { adapterView.setOnItemSelectedListener(internalItemSelectedListener); } adapterView.setOnItemLongClickListener(internalLongClickListener); } }
Example 2
Source File: MultiChoiceAdapterHelperBase.java From MultiChoiceAdapter with Apache License 2.0 | 5 votes |
public void setAdapterView(AdapterView<? super BaseAdapter> adapterView) { this.adapterView = adapterView; checkActivity(); adapterView.setOnItemLongClickListener(this); adapterView.setOnItemClickListener(this); adapterView.setAdapter(owner); parseAttrs(); if (!checkedItems.isEmpty()) { startActionMode(); onItemSelectedStateChanged(); } }
Example 3
Source File: EventHelper.java From MeiZiNews with MIT License | 4 votes |
public static void itemClick(AdapterView.OnItemClickListener li, AdapterView ...views) { if(views == null || views.length == 0) return; for(AdapterView v : views) v.setOnItemClickListener(li); }
Example 4
Source File: ItemViewHelper.java From JianshuApp with GNU General Public License v3.0 | 4 votes |
public ItemViewHelper setOnItemClickListener(int viewId, AdapterView.OnItemClickListener listener) { AdapterView view = this.getView(viewId); view.setOnItemClickListener(listener); return this; }
Example 5
Source File: ViewHolderImpl.java From commonadapter with MIT License | 4 votes |
public void setOnItemClickListener(int viewId, AdapterView.OnItemClickListener listener) { AdapterView view = findViewById(viewId); view.setOnItemClickListener(listener); }
Example 6
Source File: EventHelper.java From MVPro with Apache License 2.0 | 4 votes |
public static void itemClick(AdapterView.OnItemClickListener li, AdapterView ...views) { if(views == null || views.length == 0) return; for(AdapterView v : views) v.setOnItemClickListener(li); }
Example 7
Source File: BaseViewHolder.java From imsdk-android with MIT License | 3 votes |
/** * Sets the listview or gridview's item click listener of the view * * @param viewId The view id. * @param listener The item on click listener; * @return The BaseViewHolder for chaining. * Please use {@link #addOnClickListener(int)} (int)} (adapter.setOnItemChildClickListener(listener))} */ @Deprecated public BaseViewHolder setOnItemClickListener(@IdRes int viewId, AdapterView.OnItemClickListener listener) { AdapterView view = getView(viewId); view.setOnItemClickListener(listener); return this; }
Example 8
Source File: BaseViewHolder.java From demo4Fish with MIT License | 3 votes |
/** * Sets the listview or gridview's item click listener of the view * * @param viewId The view id. * @param listener The item on click listener; * @return The BaseViewHolder for chaining. * Please use {@link #addOnClickListener(int)} (int)} (adapter.setOnItemChildClickListener(listener))} */ @Deprecated public BaseViewHolder setOnItemClickListener(int viewId, AdapterView.OnItemClickListener listener) { AdapterView view = getView(viewId); view.setOnItemClickListener(listener); return this; }
Example 9
Source File: BaseViewHolder.java From JD-Test with Apache License 2.0 | 3 votes |
/** * Sets the listview or gridview's item click listener of the view * * @param viewId The view id. * @param listener The item on click listener; * @return The BaseViewHolder for chaining. * Please use {@link #addOnClickListener(int)} (int)} (adapter.setOnItemChildClickListener(listener))} */ @Deprecated public BaseViewHolder setOnItemClickListener(int viewId, AdapterView.OnItemClickListener listener) { AdapterView view = getView(viewId); view.setOnItemClickListener(listener); return this; }
Example 10
Source File: BaseViewHolder.java From BaseProject with Apache License 2.0 | 3 votes |
/** * Sets the listview or gridview's item click listener of the view * * @param viewId The view id. * @param listener The item on click listener; * @return The BaseViewHolder for chaining. * Please use {@link #addOnClickListener(int)} (int)} (adapter.setOnItemChildClickListener(listener))} */ @Deprecated public BaseViewHolder setOnItemClickListener(@IdRes int viewId, AdapterView.OnItemClickListener listener) { AdapterView view = getView(viewId); view.setOnItemClickListener(listener); return this; }
Example 11
Source File: AbstractViewQuery.java From COCOQuery with Apache License 2.0 | 3 votes |
/** * Register a callback method for when an item is clicked in the ListView. * * @param listener The callback method. * @return self */ public T itemClicked(AdapterView.OnItemClickListener listener) { if (view instanceof AdapterView) { AdapterView<?> alv = (AdapterView<?>) view; alv.setOnItemClickListener(listener); } return self(); }
Example 12
Source File: BaseViewHolder.java From GoogleVR with Apache License 2.0 | 2 votes |
/** * Sets the listview or gridview's item click listener of the view * * @param viewId The view id. * @param listener The item on click listener; * @return The BaseViewHolder for chaining. */ public BaseViewHolder setOnItemClickListener(int viewId, AdapterView.OnItemClickListener listener) { AdapterView view = getView(viewId); view.setOnItemClickListener(listener); return this; }
Example 13
Source File: BaseViewHolder.java From basic-adapter with MIT License | 2 votes |
/** * Sets the listview or gridview's item click listener of the view * * @param viewId The view id. * @param listener The item on click listener; * @return The BaseViewHolder for chaining. */ public BaseViewHolder setOnItemClickListener(int viewId, AdapterView.OnItemClickListener listener) { AdapterView view = getView(viewId); view.setOnItemClickListener(listener); return this; }
Example 14
Source File: BaseViewHolder.java From AndroidBase with Apache License 2.0 | 2 votes |
/** * Sets the listview or gridview's item click listener of the view * * @param viewId The view id. * @param listener The item on click listener; * @return The BaseViewHolder for chaining. */ public BaseViewHolder setOnItemClickListener(int viewId, AdapterView.OnItemClickListener listener) { AdapterView view = getView(viewId); view.setOnItemClickListener(listener); return this; }
Example 15
Source File: BaseViewHolder.java From NIM_Android_UIKit with MIT License | 2 votes |
/** * Sets the listview or gridview's item click listener of the view * * @param viewId The view id. * @param listener The item on click listener; * @return The BaseViewHolder for chaining. */ public BaseViewHolder setOnItemClickListener(int viewId, AdapterView.OnItemClickListener listener) { AdapterView view = getView(viewId); view.setOnItemClickListener(listener); return this; }