[英]How to get key events on ExpandableListView
I am getting click event on ExpandableListView
by overriting onChildClick
. 我通过覆盖
onChildClick
在ExpandableListView
上获得click事件。 This is the code 这是代码
public class SampleChooserActivity extends Activity
implements DownloadTracker.Listener, OnChildClickListener {
sampleListView.setOnChildClickListener(this);
@Override
public boolean onChildClick(
ExpandableListView parent, View view, int groupPosition, int childPosition, long id) {
// Child clicked
}
}
How can I get a similar event called another key is pressed on the child and not the click event? 如何获得类似的事件,即在孩子上按下了另一个键而不是单击事件?
这可以通过将OnClickListener
设置为子视图中的视图,同时在适配器的getChildView()
方法OnClickListener
子视图膨胀来实现。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.