In my application, I want to turn off vibration when a notification arrives. I can mute the notification sound, but could not stop the vibration.
To mute the notification sound, I used the following code:
if (audioManager.getStreamVolume(AudioManager.STREAM_NOTIFICATION) != value) {
audioManager.setStreamVolume(AudioManager.STREAM_NOTIFICATION, value, 0);
Utils.log("Volume Changed to " + value);
}
Please suggest how to change the vibration intensity of notifications to zero or suggest another way to cancel vibration when a notification arrives.
audio.setVibrateSetting(AudioManager.VIBRATE_TYPE_NOTIFICATION,
AudioManager.VIBRATE_SETTING_OFF);
setVibrateSetting not working and deprecated
I can manually change the vibration intensity of the notification on Samsung devices:
- Go to setup
- Click the My Devices tab.
- Click Sound and open Vibration Intensity.
- Select vibration intensity for incoming call, notification and feedback.
But how can I do this programmatically? please, help.