@Retention(value=CLASS)
@Target(value=METHOD)
public @interface DefaultStringSet
Use on methods in SharedPref
annotated class. The generated method
will return an empty Set
of Strings by default.
The key of the preference will be the method name by default. This can be
overridden by specifying a string resource with the keyRes()
parameter.
Implementation note:
Since SharedPreferences.getStringSet
is only available from API 11,
the generated method serializes the Set<String>
into a String
, and persists it with
SharedPreferences.Editor#putString(String, String)
using API 10 and below.
From API 11 and up, the generated method simply uses the native
SharedPreferences
Set<String>
methods.
Modifier and Type | Optional Element and Description |
---|---|
int |
keyRes |
Copyright © 2010-2014. All Rights Reserved.