im trying to vibrate device and repeat this pattern for 3 times so in total 6x vibrations. Im using code bellow but my device keeps vibrating infinitely. How to stop vibrating after those 3 repeats?
private void deviceVibration (){
long[] pattern = {0, 2000, 1000, 2000,1000};
vibrator.vibrate(pattern,3);
}