Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vibration on Xamarin Android

Im currently working on an application using Xamarin android. I cannot get the device to vibrate though.

Vibrator vibrator = (Vibrator)Activity.GetSystemService(Context.VibratorService);
vibrator.Vibrate(100);

It builds but crashes when I press the button that is linked to the code.

like image 210
Markus Olsson Avatar asked Aug 06 '14 12:08

Markus Olsson


1 Answers

This solves the problem AndroidManifest.xml

<uses-permission android:name="android.permission.VIBRATE"/>
like image 127
Dima Avatar answered Oct 12 '22 21:10

Dima