0
的子列表內的圖像視圖我有一個擴展列表視圖,其具有imageview的和TextView的。我可以點擊子視圖並執行某些操作,但是我想單擊可擴展列表的子視圖中的單獨imageview和textview,併爲每個視圖執行不同的操作。我想在主不在可擴展適配器類中執行此操作。點擊擴展列表
final ExpandableListView exlv = this.getExpandableListView();
exlv.setOnChildClickListener(new OnChildClickListener() {
public boolean onChildClick(ExpandableListView arg0, View arg1,
int arg2, int arg3, long arg4) {
Toast.makeText(ExpList.this,
"Child ItemClicked " + arg2 + " " + arg3,
Toast.LENGTH_SHORT).show();
imageView = (ImageView)arg1.findViewById(R.id.imageView2);
Log.i("ImageView Value "," hi "+imageView.toString());
imageView.setOnClickListener(new OnClickListener() {
@Override public void onClick(View arg0) { // TODO Auto-generated
Log.v("clicked", "done");
} });
// TODO Auto-generated method stub
return false;
}
});
我可以單擊圖像視圖後點擊這個代碼當然,但我想單擊圖像視圖直接在列表視圖的孩子。我怎麼能做這樣的事情或exlv.setOnImageViewClickListener?