これが私のコードです-PadsGridはViewGroupです-:
public class Emc_PadControllerActivity extends Activity implements OnTouchListener {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final PadsGrid pg = new PadsGrid(this, 8, 5, PadType.SMALL);
for (int i=0;i<pg.getChildCount();i++){
final PadController pc;
pc=(View) pg.getChildAt(i);
pc.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View arg0, MotionEvent arg1) {
pc.onTouch(arg0,arg1);
return true;
}});;
}
setContentView(pg);
}
@Override
public boolean onTouch(View v, MotionEvent event) {
v.onTouchEvent(event);
return false;
}
}
これでは、私のビューの onTouch イベントは、なぜ私がそれらに触れるのか、なぜですか?