如何以编程方式在手机默认设置中启用/禁用选择声音。(如按钮点击,布局点击声音等)guyyzz帮助......
答案 0 :(得分:3)
<uses-permission android:name="android.permission.WRITE_SETTINGS"/>
停用声音效果 putInt()
Settings.System.putInt(getContentResolver(), Settings.System.SOUND_EFFECTS_ENABLED, 0); //To disable
启用音效
Settings.System.putInt(getContentResolver(), Settings.System.SOUND_EFFECTS_ENABLED, 1); //To Enable