i posted this question already on stackoverflow, but haven't got the
answer yet that i was looking for. here is the link:
http://stackoverflow.com/questions/7182186/stop-the-system-vibration-on-receive-call-in-android



i made a BroadcastReceiver that is listening for changes in the
PHONE_STATE. in the onReceive method, i'd like to turn off the system
vibrator. i tried different approaches, but non of them worked so far.

AudioManager audioManager =
(AudioManager)ctx.getSystemService(Context.AUDIO_SERVICE);
audioManager.setVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER,
AudioManager.VIBRATE_SETTING_OFF);

or

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

or

System.putInt(ctx.getContentResolver(), System.VIBRATE_ON, 0);

or all of them together.

the first approach with the AudioManager indeed changes the system
setting for the vibration, but it does not affect the currently
ongoing one.

any ideas?

Simon

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to