Question

I want to readout the vibrate settings because I temporarily change them and want to set the original settings back again. Therefore I store the settings like this:

vibrate_save = amanager.getVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER));

and set it after my change back to the original settings:

amanager.setVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER, vibrate_save);

But after readout, vibrate_save has the value 3 on ICS (only 0,1,2 are possible). On a Android 2.2 it worked. On the explanation I saw "This method is deprecated." But what is the alternativ?

This error cames up:

10-07 13:53:58.720: E/AudioManager(6682): wrong value in setVibrateSetting vibrateType:0 vibrateSetting:3

Thanks in advance!

Was it helpful?

Solution

I don't think that ICS has the vibration settings that earlier versions did. When I look at the settings on my ICS phone (an HTC), the only option I see is "Vibration feedback for calls and notifications", and all I can do is turn that on or off. On a Samsung device running 2.3, I can set the device to vibrate "always", "never", "only in silent mode", or "only when not in silent mode". I don't know to what extent the device brands are an issue, but it seems that there just aren't the same settings in ICS. I did find the following, which allows you to control the 1 vibration setting that ICS seems to have: Changing the Vibrate settings in Jelly Bean, Android.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top