LinearLayout linerOut = (LinearLayout)listView.getChildAt(i);// 获得子级
CheckBox checskBox1 = (CheckBox) linerOut.findViewById(R.id.mCheckBox);
checskBox1.setOnClickListener(new OnClickListener(){
@Override
public void onClick(View v) {
System.out.println("checkBox ");
}
});
通过以上方法得到checkbox之后,为什么为其添加单击事件,无法执行??求解。这里面应该不是单击事件被拦截的问题。
CheckBox checskBox1 = (CheckBox) linerOut.findViewById(R.id.mCheckBox);
checskBox1.setOnClickListener(new OnClickListener(){
@Override
public void onClick(View v) {
System.out.println("checkBox ");
}
});
通过以上方法得到checkbox之后,为什么为其添加单击事件,无法执行??求解。这里面应该不是单击事件被拦截的问题。
new OnItemClickListener() { public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
long arg3) {
textView.setText("你选择的是:" + array[arg2]);
}
new OnItemSelectedListener() { public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2,
long arg3) {
textView.setText("您选择的是:" + arg0.getSelectedItem().toString());
}