Android Vibration Vibrate Indefinitely

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

using the vibrate(long[] pattern, int repeat)

Vibrator vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);

// Start time delay 
// Vibrate for 500 milliseconds 
// Sleep for 1000 milliseconds 
long[] pattern = {0, 500, 1000};

// 0 meaning is repeat indefinitely 
vibrator.vibrate(pattern, 0);


Got any Android Question?