2012-05-25 63 views

回答

2

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

source