Android获取长按按键响应
Android获取长按按键响应
http://www.2cto.com/kf/201312/261719.html
Android下Listview的onItemClick以及onItemLongClick等易模糊问题验证
http://mypyg.iteye.com/blog/850624
ListView的 OnItemLongClick
listView.setOnItemLongClickListener(new OnItemLongClickListener() { @Override public boolean onItemLongClick(AdapterView<?> arg0, View view, int position, long id) { // TODO:XXX return false; } });
另外还要
设置button属性:
- android:focusable="false"
- android:longClickable="true"
否则无法收到long click。
Activity or View 的 onKeyLongPress()方法:
@override public boolean onKeyLongPress(int keyCode, KeyEvent event) { // TODO Auto-generated method stub return super.onKeyLongPress(keyCode, event); }