frankiesardo / icepick

Android Instance State made easy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Parcelable Bundler

danielgomezrico opened this issue · comments

Hi
Im trying to use this for my parcelable classes with:

public class ParcelableBundler implements Bundler<Parcelable> {
  @Override
  public void put(String key, Parcelable value, Bundle bundle) {
    bundle.putParcelable(key, value);
  }

  @Override
  public Parcelable get(String key, Bundle bundle) {
    return bundle.getParcelable(key);
  }
}

public class PhoneValidationPresenter extends BasePresenter implements Parcelable {

}

and @State(ParcelableBundler.class) PhoneValidationPresenter mPresenter; but is not working... the variable stays null

Make sure you call Icepick.saveInstanceState and Icepick.restoreInstanceState