Skip to content

Repository files navigation

DonateHits

Persistent Helper

Easy way to persist any objects when Android screen rotation

Logo

By using this library you eliminate lot of code that is used for saving data when screen orientation changes

Use the following code to save and restore data:

publicclassExampleFragmentextendsFragment {
@PersistentprivateObjectjavaObject;
@PersistentprivateintcurrentPosition;
@OverridepublicvoidonSaveInstanceState(BundleoutState) {
super.onSaveInstanceState(outState);
PersistentHelper.saveState(this, outState, Fragment.class);
//javaObject and currentPosition saved
}
@OverridepublicvoidonViewCreated(Viewview, BundlesavedInstanceState) {
super.onViewCreated(view, savedInstanceState);
PersistentHelper.restoreState(this, savedInstanceState, Fragment.class);
//javaObject and currentPosition restored
}
For additional information mailto: dunatv@gmail.com

About

Easy way to persist any objects when Android screen rotation

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages