getBoolean
public static Boolean getBoolean(Context context,
String key,
boolean def)
throws IllegalArgumentException
Get the value for the given key, returned as a boolean. Values 'n', 'no',
'0', 'false' or 'off' are considered false. Values 'y', 'yes', '1', 'true'
or 'on' are considered true. (case insensitive). If the key does not exist,
or has any other value, then the default result is returned.
- Parameters:
key - the key to lookup
def - a default value to return
- Returns:
- the key parsed as a boolean, or def if the key isn't found or is
not able to be parsed as a boolean.
- Throws:
IllegalArgumentException - if the key exceeds 32 characters