@Retention(value=CLASS)
@Target(value=TYPE)
public @interface SharedPref
Apply @SharedPref
on an interface to create a SharedPreference helper
that will contain access methods related to the methods you define in the
interface.
You should then inject your SharedPreference generated class by using
Pref
annotation.
Example :@EBean public class MyBean { @Pref mypackage.MyPref_ myPref; } package mypackage; @SharedPref public interface MyPref { // The field name will have default value "John" @DefaultString("John") String name(); // The field age will have default value 42 @DefaultInt(42) int age(); // The field lastUpdated will have default value 0 long lastUpdated(); }
Pref
Modifier and Type | Optional Element and Description |
---|---|
int |
mode |
SharedPref.Scope |
value |
public abstract SharedPref.Scope value
public abstract int mode
Copyright © 2010-2014. All Rights Reserved.