开发者

Set Audible selection option programmatically in Android

开发者 https://www.devze.com 2023-01-17 09:48 出处:网络
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 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);      
0

精彩评论

暂无评论...
验证码 换一张
取 消