its not Else
its else
. java is case sensitive. moreover, the else
is without if
because you ended if by (;)
if (preference instanceof vibrateapp_checkbox=="true")
Vibrator.vibrate(new long[] { 0, 200, 0 }, 0);
else if (preference instanceof vibrateapp_checkbox=="false")
Vibrator.cancel();
moreover, this seems incorrect
(preference instanceof vibrateapp_checkbox=="false")
since after instanceof
, type
is expected not value
you can correct it as
if (vibrateapp_checkbox.isChecked())
Vibrator.vibrate(new long[] { 0, 200, 0 }, 0);
else
Vibrator.cancel();