Reputation: 21
How I can know if the vibrator is working? or is active ( vibrating )
Upvotes: 1
Views: 755
Reputation: 15414
To check if vibration is supported, you can use something like this
Vibrator mVibrator = (Vibrator)getSystemService(Context.VIBRATOR_SERVICE);
boolean isVibrator = mVibrator.hasVibrator();
The hasVibrator()
returns true if vibration is supported by the device.
To detect if vibration is active, it is not currently supported by Android. (source)
Upvotes: 1