i had this error The method getSystemService(String) is undefined for the type WebAppInterface
when I use " getSystemService". I worked in interface class not activity class .
@JavascriptInterface
public void Viber(String value ) {
if (value.equals("on")) {
// Get instance of Vibrator from current Context
Vibrator v = (Vibrator)getSystemService(mContext.VIBRATOR_SERVICE);
// Vibrate for 300 milliseconds
v.vibrate(300);
}
}