カスタムのexpandablelistviewを使用していますが、アダプターはアクティビティの範囲外です。私のアクティビティでは、onclicklistenerを次のように設定できます。
mTopicsExpandListView.setOnChildClickListener(new ExpandableListView.OnChildClickListener() {
public boolean onChildClick(ExpandableListView parent, View v,
int groupPosition, int childPosition, long id) {
Log.i("MEAT", "This child row was clicked!");
return false;
}
});
しかし、静的変数を使用する必要性を回避するために、近い将来、アダプター自体で実装OnChildClickListenerを使用できるようにしたかったのです。
public class MExpandableListAdapter extends BaseExpandableListAdapter implements OnChildClickListener {
public boolean onChildClick(ExpandableListView parent, View v,
int groupPosition, int childPosition, long id) {
Log.i("MEAT", "This child row was clicked!");
return false;
}
しかし、後者は何もしません。2番目のケースは何か違うのですか?IsChildSelectableがtrueに設定されている