How I can know if the vibrator is working? or is active ( vibrating ) - Android

How I can know if the vibrator is working? or is active ( vibrating )

Upvotes: 1

Views: 755

Answers (1)

Antrromet
Antrromet

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

Related Questions