1
如何在Android系統中關閉振動器?振動器很無聊。如何在Android系統中關閉振動器?
如何在Android系統中關閉振動器?振動器很無聊。如何在Android系統中關閉振動器?
上SO快速搜索給了我這個soution:
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);