当前位置: 代码迷 >> Android >> Android 长按setOnItemLongClickListener 显示context Menu(下上文菜单)
  详细解决方案

Android 长按setOnItemLongClickListener 显示context Menu(下上文菜单)

热度:92   发布时间:2016-05-01 15:18:14.0
Android 长按setOnItemLongClickListener 显示context Menu(上下文菜单)

Android 长按setOnItemLongClickListener? 显示context Menu(上下文菜单) 例子...

?

private ListView fileList;

?

?

		fileList				.setOnCreateContextMenuListener(new OnCreateContextMenuListener() {					@Override					public void onCreateContextMenu(ContextMenu menu, View v,							ContextMenuInfo info) {						// TODO Auto-generated method stub						menu.setHeaderTitle(R.string.contentMenu);						menu.add(0, AndBoxConstant.OPEN, 0, R.string.open);						menu.add(0, AndBoxConstant.PROPERTIY, 6,								R.string.properties);					}				});

?

?

			fileList.setOnItemLongClickListener(new OnItemLongClickListener() {				@Override				public boolean onItemLongClick(AdapterView<?> ada, View view,						int index, long longIndex) {					fileList.showContextMenu();					return true;				}			});

?

  相关解决方案