org.androidannotations.annotations.sharedpreferences
Annotation Type SharedPref


@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();
 }
 

See Also:
Pref

Optional Element Summary
 int mode
           
 SharedPref.Scope value
           
 

value

public abstract SharedPref.Scope value
Default:
org.androidannotations.annotations.sharedpreferences.SharedPref.Scope.ACTIVITY

mode

public abstract int mode
Default:
0


Copyright © 2010-2014. All Rights Reserved.