Last active
November 13, 2017 11:37
-
-
Save nieldeokar/00676ad258113c92a7efcc022028cac2 to your computer and use it in GitHub Desktop.
This would create a custom vibrate pattern.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void customVibratePatternNoRepeat() { | |
// 0 : Start without a delay | |
// 400 : Vibrate for 400 milliseconds | |
// 200 : Pause for 200 milliseconds | |
// 400 : Vibrate for 400 milliseconds | |
long[] mVibratePattern = new long[]{0, 400, 200, 400}; | |
// -1 : Do not repeat this pattern | |
// pass 0 if you want to repeat this pattern from 0th index | |
vibrator.vibrate(mVibratePattern, -1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment