ExpandableListView를 사용하고 있습니다.
child안에 버튼을 두고 이 버튼이 클릭될 때 이벤트가 발생하도록 하려합니다.
근데 child안에 있는 버튼의 버튼 클릭이벤트가 먹지를 않아서 도움 요청합니다..ㅠㅠ
아래와 같이 getChildView안에서 setOnClick을 해주었고 onClick함수를 두었습니다.
근데 버튼을 눌러도 INVISIBLE 하도록 set해놓은 것이 먹지를 않습니다.ㅠㅠㅠㅠ
이유가 무엇인가요ㅠㅠ
조언 꼭 부탁드립니다ㅠㅠ
class PageDetailChildAdapter extends BaseExpandableListAdapter implements OnClickListener{
final int group,
final int child,
final boolean lastChild,
final View reuse,
final ViewGroup parent) {
AbsListView.LayoutParams layout_content_params = new AbsListView.LayoutParams(
ViewGroup.LayoutParams.FILL_PARENT, 660);
final ViewGroup view = getChildViewGroup(reuse, parent);
view.setLayoutParams(layout_content_params);
view.setPadding(0, 0, 0, 0);
final PageDetailChild topping = catagories[group].toppings[child];
mApp.btn = ((Button)view.findViewById(R.id.img_keyfeature));
mApp.btn.setOnClickListener(this);
((TextView)view.findViewById(R.id.text)).setText(topping.name);
mApp.btn.setBackgroundResource(topping.img);
mApp.btn.setVisibility(View.VISIBLE);
return view;
}
public void onClick(View v)
{
switch(v.getId())
{
case R.id.img_keyfeature:
mApp.btn.setVisibility(View.INVISIBLE);
break;
}
}




이거... 리스트에 버튼이 여러 개일텐데, mApp.btn 은 버튼하나밖에 기억 못하지 않습니까?
다음 줄이 호출될 때마다 mApp.btn이 바뀌고 있습니다.
mApp.btn = ((Button)view.findViewById(R.id.img_keyfeature));