I use the following snippet to vibrate the phone in a specific pattern, but it throws and ArrayIndexOutOfBoundsException.
vibrator.vibrate(new long[] { selectedDuration, CONSTANT_DELAY }, REPEAT);
But
vibrator.vibrate(VIBRATE_DURATION);
works fine. Any pointers?
The docs say:
Means REPEAT is only allowed to be 0 or 1 in your case.
This is the implementation: