Button
が押されて離されたとき、どうすれば聞くことができますか?
37138 次
3 に答える
88
あなたは使用することができますonTouchListener
:
view.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
switch(event.getAction()) {
case MotionEvent.ACTION_DOWN:
// PRESSED
return true; // if you want to handle the touch event
case MotionEvent.ACTION_UP:
// RELEASED
return true; // if you want to handle the touch event
}
return false;
}
});
于 2012-08-02T14:07:15.650 に答える
4
于 2012-08-02T14:07:22.610 に答える