How to access vibrator in android in a class that is not extending activity?
问题 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)