Created
November 13, 2017 11:18
-
-
Save nieldeokar/8f0eaff1a8906a6bf318bf03e82077cd to your computer and use it in GitHub Desktop.
Using Vibrate in android demo snippet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<uses-permission android:name="android.permission.VIBRATE"/> | |
Vibrator vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE); | |
if (vibrator.hasVibrator()) { | |
vibrator.vibrate(500); // for 500 ms | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment