2

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

4

1 回答 1

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);

资源

于 2012-05-25T04:02:02.897 回答