public boolean onLongClick(View v) { eraserButton.setChecked(true); Vibrator vibrator = (Vibrator) getContext().getSystemService(Context.VIBRATOR_SERVICE); vibrator.vibrate(40); mEraseMenuWindow.show(); return true; }
public void onClick(View v) { if (mEraseMenuWindow.lastClosedByAnchorTouch() == true) { return; } if (eraserButton.previousStateWasChecked()) { Vibrator vibrator = (Vibrator) getContext().getSystemService(Context.VIBRATOR_SERVICE); vibrator.vibrate(40); mEraseMenuWindow.show(); } }