|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ryanm.preflect.Persist
public class Persist
Allows storage of configurations. Configurations are JSON-encoded
and placed in a SharedPreferences
| Method Summary | |
|---|---|
static void |
delete(Activity owner,
java.lang.String savename)
Deletes a saved configuration |
static java.lang.String[] |
listSaves(Activity owner)
Lists saved configurations |
static void |
load(Activity owner,
java.lang.String savename,
java.lang.Object... roots)
Loads and applies a saved configuration. |
static boolean |
onActivityResult(int requestCode,
int resultCode,
Intent data,
Activity owner,
java.lang.String autoSaveName,
java.lang.Object... configTargets)
Call this from your activity in Activity
.onActivityResult() as an alternative to
Preflect.onActivityResult(int, int, Intent, Object...)
to apply a configuration and to automatically save the
configuration |
static void |
save(Activity owner,
java.lang.String savename,
java.lang.Object... roots)
Saves the configuration of an object tree |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static boolean onActivityResult(int requestCode,
int resultCode,
Intent data,
Activity owner,
java.lang.String autoSaveName,
java.lang.Object... configTargets)
Activity
.onActivityResult() as an alternative to
Preflect.onActivityResult(int, int, Intent, Object...)
to apply a configuration and to automatically save the
configuration
requestCode - from Activity.onActivityResult()resultCode - from Activity.onActivityResult()data - from Activity.onActivityResult()owner - The Activity that will own the saved
configurationautoSaveName - The name of the saved configurationconfigTargets - roots of the object trees to apply configurations to
true if the configuration was applied,
false otherwise
public static void save(Activity owner,
java.lang.String savename,
java.lang.Object... roots)
owner - The activity that owns the datasavename - The name of the saved dataroots - The objects whose configuration to save
public static void load(Activity owner,
java.lang.String savename,
java.lang.Object... roots)
owner - The activity that owns the datasavename - The name of the saved dataroots - The objects to apply the configuration to
public static void delete(Activity owner,
java.lang.String savename)
owner - The activity that owns the datasavename - The name of the save to deletepublic static java.lang.String[] listSaves(Activity owner)
owner - The activity that owns the saves
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||