I'm trying to use a vibration pattern when vibrating the phone. I'm using:
Vibrator v = (Vibrator) this.getSystemService(Context.VIBRATOR_SERVICE);
// Vibrate for 500 milliseconds
long[] longs = { 2, 0, 0, 0, 2, 0 , 0, 0, 2 };
v.vibrate(longs, 1);
and it just doesn't stop vibrating.
- If I use
v.vibrate(longs, -1);
it doesn't vibrate at all. - If I use
v.vibrate(longs, 0);
it doesn't vibrate at all. - If I use
v.vibrate(longs, 2);
or any number higher than 1, it vibrates indefinitely. - If I change the long values to so they're higher or lower it makes no difference.
I've read the documentation and some tutorials and I don't think I've done anything wrong here. Why isn't it vibrating properly?
Note: I use other apps that vibrate in patterns properly so I know it's not an issue with my phone.