Android Utililty Methods Vibrator Vibrate

List of utility methods to do Vibrator Vibrate

Description

The list of methods to do Vibrator Vibrate are organized into topic(s).

Method

voidVibrate(final Activity activity, long milliseconds)
Vibrate
Vibrator vib = (Vibrator) activity
        .getSystemService(Service.VIBRATOR_SERVICE);
vib.vibrate(milliseconds);
voidVibrate(final Activity activity, long[] pattern, boolean isRepeat)
Vibrate
Vibrator vib = (Vibrator) activity
        .getSystemService(Service.VIBRATOR_SERVICE);
vib.vibrate(pattern, isRepeat ? 1 : -1);
voidvibrar(Context context)
vibrar
((Vibrator) context.getSystemService(context.VIBRATOR_SERVICE))
        .vibrate(200);
voidvibrar(Context context, long tempo)
vibrar
((Vibrator) context.getSystemService(context.VIBRATOR_SERVICE))
        .vibrate(tempo);
voidvibrate(Context context, int duration)
vibrate
if (hasVibrationPermission(context)) {
    ((Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE))
            .vibrate(duration);