Android Vibrator Vibrate Vibrate(final Activity activity, long[] pattern, boolean isRepeat)

Here you can find the source of Vibrate(final Activity activity, long[] pattern, boolean isRepeat)

Description

Vibrate

Declaration

public static void Vibrate(final Activity activity, long[] pattern,
        boolean isRepeat) 

Method Source Code

//package com.java2s;
import android.app.Activity;
import android.app.Service;

import android.os.Vibrator;

public class Main {

    public static void Vibrate(final Activity activity, long milliseconds) {
        Vibrator vib = (Vibrator) activity
                .getSystemService(Service.VIBRATOR_SERVICE);
        vib.vibrate(milliseconds);/*from  w w w.j a  v a 2  s . co  m*/
    }

    public static void Vibrate(final Activity activity, long[] pattern,
            boolean isRepeat) {
        Vibrator vib = (Vibrator) activity
                .getSystemService(Service.VIBRATOR_SERVICE);
        vib.vibrate(pattern, isRepeat ? 1 : -1);
    }
}

Related

  1. Vibrate(final Activity activity, long milliseconds)
  2. vibrar(Context context)
  3. vibrar(Context context, long tempo)
  4. vibrate(Context context, int duration)