如何关闭Android系统中的振动器?

时间:2012-05-25 03:42:41

标签: android

如何在Android系统范围内关闭振动器?振动器很无聊。

1 个答案:

答案 0 :(得分:2)

快速搜索SO给了我这个意思:

AudioManager audioManager = (AudioManager)ctx.getSystemService(Context.AUDIO_SERVICE);
audioManager.setVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER, AudioManager.VIBRATE_SETTING_OFF);
audioManager.setVibrateSetting(AudioManager.VIBRATE_TYPE_NOTIFICATION, AudioManager.VIBRATE_SETTING_OFF);
System.putInt(ctx.getContentResolver(), VIBRATE_IN_SILENT, 0);

source