My source code is:

```
import android.content.Context;
import android.hardware.SensorManager;

public class ShakeEvent implements SensorEventListener  {
     private static SensorManager sensorManager;
     ...
     ...
     public static boolean isSupported (){
          sensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE);

```

I receive error message that getSystemService function is undefined.
I tried to write this row also in such way:

```
sensorManager = (SensorManager) getContext().getSystemService(Context.SENSOR_SERVICE);

```

But then I receive error message that getContext() function is undefined for ShakeEvent object.
How should I write it? Thanks.