I am creating an application i开发者_开发百科n Android for which I need to be able to enable or disable programmatically, the audible selection option that we see in the Sound and DIsplay settings. I am not able to find the API for this. Please help me with it.
from https://github.com/CyanogenMod/android_packages_apps_Settings/blob/ics/src/com/android/settings/SoundSettings.java
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
AudioManager am = (AudioManager)getSystemService(Context.AUDIO_SERVICE);
am.loadSoundEffects();
Settings.System.putInt(getContentResolver(), Settings.System.SOUND_EFFECTS_ENABLED,1);
精彩评论