这几天做项目的时候用到了一个开源的下拉刷新的框架(需要的朋友可以加我Q:359222347)。其中我使用PullToRefreshExpandableListView的时候发现这个东西没有setOnChildClickListener()的点击方法。刚刚在一个国外的网站上看到一个解决的方法:
mPullRefreshListView = (PullToRefreshExpandableListView) findViewById(R.id.pull_refresh_expandable_list); ExpandableListView expandableListView = mPullRefreshListView.getRefreshableView(); expandableListView.setOnChildClickListener(new OnChildClickListener() { @Override public boolean onChildClick(ExpandableListView arg0, View arg1, int arg2, int arg3, long arg4) { // TODO Auto-generated method stub Log.i("xxxxxxxxxxxxx","group:"+arg2+" child"+arg3); return false; } });
这样就解决了没有点击事件的方法了。