该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
//向前飞
forwardbth.setOnTouchListener(
new View.OnTouchListener() {
public boolean onTouch(View v, MotionEvent event) {
// TODO Auto-generated method stub
char command = '1';
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
SendCommand(command);
break;
case MotionEvent.ACTION_UP:
SendCommand(stop);
break;
default:
break;
}
return false;
}
});
//向后飞
backbth.setOnTouchListener(new View.OnTouchListener() {
public boolean onTouch(View v, MotionEvent event) {
// TODO Auto-generated method stub
char command = '2';
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
SendCommand(command);
break;
case MotionEvent.ACTION_UP:
SendCommand(stop);
break;
default:
break;
}
return false;
}
});