public class MyBroadcastReceiver extends BroadcastReceiver{
public void onReceive(Context context , Intent intent){
Toast.makeText(context, "Your time is up", Toast.LENGTH_LONG).show();
Vibrator vibrator;
// ERROR here (vibrator)context.getSystemService(Context.VIBRATOR_SERVICE);
vibrator.vibrate(2000);
}
}
使用广播接收器在使用警报时振动设备时,出现如上所示的错误。这里出现错误的可能原因是什么?