Really, I see no reason to look up a string for a preference key in an xml file

If we have to use a key to lookup the string for the key, we can just use that key as the preference key.
live-sensor-data
Andreas Shimokawa 2015-06-13 01:12:08 +02:00
parent cfedf4acde
commit d2f7169de4
3 changed files with 2 additions and 3 deletions

View File

@ -41,7 +41,7 @@ public class GBApplication extends Application {
public static boolean isFileLoggingEnabled() {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(GBApplication.getContext());
return prefs.getBoolean(GBApplication.getContext().getString(R.string.pref_log_to_file), false);
return prefs.getBoolean("log_to_file", false);
}
private void setupLogging() {

View File

@ -102,7 +102,6 @@
<string name="pref_header_vibration_count">Vibration Count</string>
<string name="title_activity_sleepmonitor">Sleep Monitor</string>
<string name="pref_log_to_file">LogToFile</string>
<string name="pref_write_logfiles">Write Log Files (needs restart)</string>
<string name="initializing">initializing</string>
<string name="busy_task_fetch_activity_data">Fetching Activity Data</string>

View File

@ -66,7 +66,7 @@
android:title="@string/pref_header_development">
<CheckBoxPreference
android:defaultValue="false"
android:key="@string/pref_log_to_file"
android:key="log_to_file"
android:title="@string/pref_write_logfiles" />
</PreferenceCategory>
</PreferenceScreen>