Search code examples
androidandroid-4.2-jelly-beanvibrationandroid-audiomanager

Changing the Vibrate settings in Jelly Bean, Android


I am looking for how we change the vibrate settings in Jelly Bean. I found that all the pre-JB vibrate settings have been deprecated, but don't see any new AudioManager.[change the vibrate settings] code anywhere. There is a setting "Vibrate when ringing" which I would like to know how to play with.

Thanks for you help.


Solution

  • In android4.1 you can use this to control "vibrate & ringing"

    Settings.System.putInt(mContentResolver, Settings.System.VIBRATE_WHEN_RINGING, enable ? 1 : 0);