手机中的设置 setVibrateSetting(AudioManager.VIBRATE_TYPE_NOTIFICATION, false) 在哪里?
我制作了一个扰乱系统振动设置的应用程序。也就是说,它会关闭它们。
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);
我现在想知道在哪里可以手动重新打开振动。铃声振动设置可以在声音设置中找到,但是通知设置在哪里?短信应用程序中的设置仍然是“始终振动”,但手机在收到短信时不再振动。可以通过编程方式打开/关闭此设置吗?
顺便说一句:我使用的是 Android 2.3.3 的 Nexus One,
谢谢 西蒙
i made an app that messes with the system vibrate settings. namely, it turns them off.
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);
i wonder now, where i can turn the vibration manually back on. the ringer vibrate setting can be found in the Sound settings, but where is the notification setting? the setting in the SMS app is still on "vibrate always", but the phone does not vibrate anymore when receiving a text. can this setting just be turned on/off programmatically?
btw: i am using a Nexus One with Android 2.3.3
Thx
Simon
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您所要做的就是与上面所做的完全相同,只是将
AudioManager.VIBRATE_SETTING_OFF
设置为AudioManager.VIBRATE_SETTING_ON
All you have to do is the exact same thing you did above except set
AudioManager.VIBRATE_SETTING_OFF
toAudioManager.VIBRATE_SETTING_ON