-Add permission to android Manifest file
<uses-permission android:name="android.permission.VIBRATE" />
- In java file:
Vibrator vibrator;
- In Oncreage:
vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
- Use it:
vibrator.vibrate(30);
No comments:
Post a Comment