展会信息港展会大全

Camera Shutter Sound can't restore to default
来源:互联网   发布日期:2015-09-29 10:08:57   浏览:2001次  

导读:Launch Camera -- check shutter sound default status is OFF -- set the shutter sound status to ON -- click the restore to default button -- the shutter sound st......

Launch Camera --> check shutter sound default status is "OFF" --> set the shutter sound status to "ON" --> click the restore to default button --> the shutter sound status isn't the default value "OFF"

As the customization and the value of SDMID isn't "on" or "off",so I must translate it in the java code. But the preference.xml has the definition (KEY_SHUTTER_SOUND),and the default value is this:

<ListPreference

camera:key = "pref_camera_shutter_sound"

camera:defaultValue="@string/pref_camera_shutter_sound_default"

...

/>

If I don't deal with it,the default value isn't via customization but

camera:defaultValue="@string/pref_camera_shutter_sound_default"

So I set the shutter sound default value in the method restorePreferences()in the CameraSettings.java manually.I add a function:

private static void setShutterSoundDefault() {

SharedPreferences.Editor editor = preferences.edit();

editor.putString(KEY_SHUTTER_SOUND,shutterValue);

editor.apply();

}

andadd it end of the restorePreference().The shutterValue is from SDM which you want to custom,not

camera:defaultValue="@string/pref_camera_shutter_sound_default"

OK,it can work now.

赞助本站

人工智能实验室

相关热词: Camera

AiLab云推荐
展开

热门栏目HotCates

Copyright © 2010-2024 AiLab Team. 人工智能实验室 版权所有    关于我们 | 联系我们 | 广告服务 | 公司动态 | 免责声明 | 隐私条款 | 工作机会 | 展会港