0
을 클릭 호출 할 난목록보기, 나는 내 목록보기 행이 이미지 버튼으로 채워 얻을 관리 목록보기를 클릭하여 ImageButton에 리스너
을안드로이드 추가 이후 : descendantFocusability = "blocksDescendants"
을 row.xml에 추가하면 클릭 수신기 (ImageButton 및 Listview 행)를 모두 가질 수 있습니다.
그러나 특수한 경우에는 Listview 클릭 수신기가 ImageButton 클릭 영역에도 반응하기를 원합니다. (단순히 ImageButton이없는 것처럼) 가능합니까?
fragment.java :
myList.setOnGroupClickListener(new ExpandableListView.OnGroupClickListener() {
@Override
public boolean onGroupClick(ExpandableListView parent, View v, int groupPosition, long id) {
doRowOnClickStuff();
return true;
}
});
listAdapter.java
public View getGroupView(int groupPosition, boolean isExpanded, View convertView, final ViewGroup parent) {Charakter charakter = (Charakter) getGroup(groupPosition);
if(convertView == null)
{
LayoutInflater layoutInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = layoutInflater.inflate(R.layout.group_row, parent, false);
}
TextView heading = (TextView) convertView.findViewById(R.id.heading);
final ImageButton imageButton = (ImageButton) convertView.findViewById(R.id.groupimagebutton);
imageButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view)
{
//in some cases, I want to call the Listview click listener and not imageButton click listener
}