Example usage for android.os Vibrator vibrate

List of usage examples for android.os Vibrator vibrate

Introduction

In this page you can find the example usage for android.os Vibrator vibrate.

Prototype

@RequiresPermission(android.Manifest.permission.VIBRATE)
    public void vibrate(VibrationEffect vibe, AudioAttributes attributes) 

Source Link

Usage

From source file:com.sentaroh.android.SMBSync.SMBSyncMain.java

private void vibrateDefaultPattern() {
    Thread th = new Thread() {
        @Override/*from  w  w  w. j  a  va  2s  .  c om*/
        public void run() {
            Vibrator vibrator = (Vibrator) mContext.getSystemService(Context.VIBRATOR_SERVICE);
            vibrator.vibrate(new long[] { 0, 200, 400, 200, 400, 200 }, -1);
        }
    };
    th.start();
}