Java Code Examples for android.widget.AbsListView#performItemClick()

The following examples show how to use android.widget.AbsListView#performItemClick() . 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: ClickableView.java    From Dashchan with Apache License 2.0 6 votes vote down vote up
@Override
public void onClick(View v) {
	long t = System.currentTimeMillis();
	if (t - lastClick < 200L) {
		return;
	}
	lastClick = t;
	if (onClickListener != null) {
		onClickListener.onClick(v);
	} else if (isListParent()) {
		AbsListView listView = listParent.get();
		if (listView != null) {
			View view = ListViewUtils.getRootViewInList(this);
			if (view != null) {
				int position = getListPosition(listView);
				if (position >= 0) {
					listView.performItemClick(this, position, listView.getItemIdAtPosition(position));
				}
			}
		}
	}
}
 
Example 2
Source File: AndroidTester.java    From aedict with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Clicks item on given {@link ListView}.
 * 
 * @param listViewId
 *            the ListView id
 * @param position
 *            the item position.
 */
public void click(final int listViewId, final int position) {
	final AbsListView lv = (AbsListView) get(listViewId);
	lv.performItemClick(lv, position, position);
}