Android phone vibrate does not stop using undo method

I wrote a code that disconnects the phone when an incoming call arrives. When the phone is in vibrating mode, I use the following code to stop the phone from vibrating:

Vibrator vib = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);
vib.cancel();

While it worked on my Nexus One with Android 2.1, it seems that it does not stop vibration on the HTC Desire phone with Android 2.1. Has anyone encountered this issue?

Doron

+3
source share
2 answers

The vibration does not seem to stop, because in some cases, before the start of the vibration, a stop vibration code is executed that is connected to the broadcast receiver of the incoming call, and therefore it seems that the vibration does not stop.

, , , , , , .

0

Android, -. vibrate(3000);, , 3 , ?

0

Source: https://habr.com/ru/post/1754005/


All Articles