title: Vibrate android phone from non-activity class
body: <p>I am trying to make my android phone vibrate after the ball hits the target in the game, so I created inner class <code>Vibrate</code> which extend Activity as my outer class is non-activity </p>
  
  <pre><code>public class TheGame extends GameThread {
    public class Vibrate extends Activity {
      Vibrator v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
    }
  //some methods 
  
    protected void updateGame(float secondsElapsed){
      //updating coordinates and if ball hits the target &gt;&gt; vibrate 
      TheGame.Vibrate vib = new TheGame.Vibrate();
      vib.v.vibrate(500);
  
    }
   }
  </code></pre>
  
  <p>How can I call a vibration (<code>Vibration v</code> -inner class) from an outer class?? At this moment program stops at shows "unfortunately, app has stopped" and "too much output to process android" in Logcat
  //////////</p>
  
  <p>Finally worked by the help of dhke. I just needed to access getSystemService(...) from Context which I Extended in outer class.   </p>