Changing the Vibrate settings in Jelly Bean, Android

Matthew picture Matthew · Jul 2, 2012 · Viewed 7.7k times · Source

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.

Answer

house picture house · Jul 30, 2012

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

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