title: How to access vibrator in android in a class that is not extending activity?
body: <p>I'm trying to access the vibrator using the following in class called VibrationManager and the class is not extending Activity</p>
  
  <pre><code>Vibrator v =(Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
  </code></pre>
  
  <p>but eclipse throws and error like</p>
  
  <p>The method getSystemService(String) is undefined for the type VibrationManager</p>
  
  <p>This is my whole Class</p>
  
  <pre><code>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){
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Please help</p>