I have put this section of code in my Setting Activity, so if the vibration box in the xml file which is working is checked, vibrators will be turned on and if not they will be cancelled. However, there seems to be a problem with the else that won't let me run the app. Any help would be appreciated, thanks.
if (preference instanceof vibrateapp_checkbox=="true");
Vibrator.vibrate(new long[] { 0, 200, 0 }, 0);
Else if (preference instanceof vibrateapp_checkbox=="false");
Vibrator.cancel();