Answers for "how to make phone vibrate android studio"

2

how to make phone vibrate android studio

// Vibrate for 150 milliseconds
private void shakeItBaby() {
    if (Build.VERSION.SDK_INT >= 26) {
        ((Vibrator) getSystemService(VIBRATOR_SERVICE)).vibrate(VibrationEffect.createOneShot(150, VibrationEffect.DEFAULT_AMPLITUDE));
    } else {
        ((Vibrator) getSystemService(VIBRATOR_SERVICE)).vibrate(150);
    }
}
Posted by: Guest on January-25-2021

Code answers related to "how to make phone vibrate android studio"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language