iv_picture_production.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View view, MotionEvent motionEvent) { if(motionEvent.getAction() == MotionEvent.ACTION_UP){ Log.d("Listener", "UP"); myApp.MakeToast("up"); } if(motionEvent.getAction() == MotionEvent.ACTION_DOWN){ Log.d("Listener", "DOWN"); myApp.MakeToast("down"); } return false; } }); iv_picture_production.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Log.d("Listener", "CLICK"); myApp.MakeToast("click"); } });
PS:第一个监听器中返回的boolean类型,如果是true,则会覆盖第二个监听器的点击事件。