标签:android style blog class code java
listView.setOnCreateContextMenuListener(new View.OnCreateContextMenuListener() { @Override public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { menu.add(0, 0, 0, "删除单号"); menu.add(0, 1, 1, "接收此单"); } });
@Override public boolean onContextItemSelected(MenuItem item) { Log.d("TEST", item.getTitle().toString()); if(item.getMenuInfo() instanceof AdapterContextMenuInfo) { AdapterContextMenuInfo info = (AdapterContextMenuInfo)item.getMenuInfo(); Log.d("TEST", info.position+"--"); } return super.onContextItemSelected(item); }
Android ListView 长按列表弹出菜单,布布扣,bubuko.com
标签:android style blog class code java
原文地址:http://www.cnblogs.com/daxin/p/3725565.html