Code example for Vibrator

Methods: cancel

0
    if (player != null) {
      Log.d(TAG, "Stopping ringer");
      player.stop();
    } 
    Log.d(TAG, "Cancelling vibrator" );
    vibrator.cancel();
  } 
 
  private boolean shouldVibrate() { 
    if(player == null) {
      return true; 
    } 
 
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
      return shouldVibrateNew(context);
    } 
    return shouldVibrateOld(context);
  } 
 
  @SuppressLint("NewApi")