Guest User

Untitled

a guest
Aug 15th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. Vibrate setting not turning off on receiving incoming call - Android
  2. AudioManager audioManager = (AudioManager)
  3. context.getSystemService(Context.AUDIO_SERVICE);
  4. audioManager.setVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER,
  5. AudioManager.VIBRATE_SETTING_OFF);
  6.  
  7. Vibrator vib = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);
  8. vib.cancel();
  9.  
  10. if (shouldVibrate() && mVibratorThread == null) {
  11. mContinueVibrating = true;
  12. mVibratorThread = new VibratorThread();
  13. mVibratorThread.start(); }
Add Comment
Please, Sign In to add comment