当前位置:编程学习 > JAVA >>

ExpandableListView

BaseExpandableListAdapter中的
public View getChildView(final int groupPosition, final int childPosition, boolean isLastChild,   View convertView, ViewGroup parent) {....中自定义了onLongClick()目的是想让子项实现长按事件},可是定义完后,子项的点击事件onChildClick()不能响应了,这是肿么回事啊?望大神指点! 把自定义的onLongClick()事件注释掉,子项的点击事件就可以响应了.. 
贴出onLongClick代码:
public View getChildView(final int groupPosition, final int childPosition, boolean isLastChild,View convertView, ViewGroup parent) {

LinearLayout ly = (LinearLayout)view.findViewById(R.id.lay_001);
ly.setOnLongClickListener(new OnLongClickListener() {
public boolean onLongClick(View v) {
......... }
})
.setNegativeButton("取消",
new DialogInte易做图ce.OnClickListener() {

@Override
public void onClick(DialogInte易做图ce dig,
int arg1) {
dig.cancel();
}
}).create();
dialog.show();
return false;
}
});
}
贴出onChildClick代码:
OnChildClickListener listener = new OnChildClickListener() {

@Override
public boolean onChildClick(ExpandableListView arg0, View arg1,
int arg2, int arg3, long arg4) {
return true;
}
}; android --------------------编程问答-------------------- 请教 大神 如何实现 Expandable 子项的点击与长按事件?谢谢!
补充:Java ,  Java SE
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,