Code example for Vibrator

Methods: cancel, vibrate

0
 
  synchronized public void play(Uri uri, boolean vibrate, int timeout, int volume, int delay) {
    if (mPlaying) stop();
 
    if (vibrate) {
      mVibrator.vibrate(sVibratePattern, 0);
    } 
    else { 
      mVibrator.cancel();
    } 
 
    mUri = uri;
    mDelay = delay;
    mVolume = volume; 
    startplaying(); 
 
    mPlaying = true;
    enableKiller(timeout);
  } 
  public void stop() 
  { 
    if (mPlaying) {
      mPlaying = false;
      if (mMediaPlayer != null) 
        mMediaPlayer.stop();
 
      mVibrator.cancel();
    } 
    disableKiller(); 
  } 
 
  void setKillerCallback(KillerCallback killerCallback) {