I'm trying to access the vibrator using the following in class called VibrationManager and the class is not extending Activity
Vibrator v =(Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
but eclipse throws and error like
The method getSystemService(String) is undefined for the type VibrationManager
This is my whole Class
public class VibrationManager {
private static VibrationManager me = null;
Vibrator v = null;
private Vibrator getVibrator(){
if(v == null){
v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
}
return v;
}
public static VibrationManager getManager() {
if(me == null){
me = new VibrationManager();
}
return me;
}
public void vibrate(long[] pattern){
}
}
Please help