Code example for View.OnClickListener

Methods: onClick

0
			setAdapter(new SlidingMenuListAdapter(context));
			setOnItemClickListener(new OnItemClickListener() {
				public void onItemClick(AdapterView<?> parent, View view, int position,
						long id) {
					OnClickListener listener = ((SlidingMenuListAdapter)getAdapter()).getItem(position).mListener;
					if (listener != null) listener.onClick(view);
				}				 
			}); 
		} 
		public void add(MenuListItem mli) {
			((SlidingMenuListAdapter)getAdapter()).add(mli);
		} 
	} 
 
	public static class SlidingMenuListAdapter extends ArrayAdapter<MenuListItem> {
 
		public SlidingMenuListAdapter(Context context) {
			super(context, 0);
		} 
		public View getView(int position, View convertView, ViewGroup parent) {
			View v;