public class

SupportSettingsUtils

extends Object
java.lang.Object
   ↳ com.openxc.util.SupportSettingsUtils

Summary

Public Constructors
SupportSettingsUtils()
Public Methods
static Set<String> getStringSet(SharedPreferences preferences, String key, Set<String> defaultValue)
Retreive a set of strings from SharedPreferences, using the built-in getStringSet method if available and falling back to a comma separated String if not.
static void putStringSet(SharedPreferences.Editor editor, String key, Set<String> value)
Store a set in SharedPreferences, using the built-in putStringSet method if available and falling back to a comma separated String if not.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public SupportSettingsUtils ()

Public Methods

public static Set<String> getStringSet (SharedPreferences preferences, String key, Set<String> defaultValue)

Retreive a set of strings from SharedPreferences, using the built-in getStringSet method if available and falling back to a comma separated String if not. Note that this is a simple approach that won't work if the values in the set contain commas.

Parameters
preferences the SharedPreferences to retreive the set from.
key the key for the preference.
defaultValue the default value to return if the preference is not stored.
Returns
  • The set if found, otherwise the default value

public static void putStringSet (SharedPreferences.Editor editor, String key, Set<String> value)

Store a set in SharedPreferences, using the built-in putStringSet method if available and falling back to a comma separated String if not. Note that this is a simple approach that won't work if the values in the set contain commas.

Parameters
editor the editor to store the set in.
key the key for the preference.
value the value to store with the key.