当前位置: 代码迷 >> Android >> [android]在下上文菜单的选中事件中获取列表选中的元素
  详细解决方案

[android]在下上文菜单的选中事件中获取列表选中的元素

热度:43   发布时间:2016-05-01 18:56:09.0
[android]在上下文菜单的选中事件中获取列表选中的元素


[android]在上下文菜单的选中事件中获取列表选中的元素

?

?

/**     * 上下文菜单的选中事件.     */	@Override	public boolean onContextItemSelected(MenuItem item) {		AdapterContextMenuInfo itemInfo = (AdapterContextMenuInfo)item.getMenuInfo();		int position = itemInfo.position;		//这里就可以根据获得的position来取得列表中选中的元素		return super.onContextItemSelected(item);	}
?
  相关解决方案