@Override protected void onCreate(Bundle savedState) { super.onCreate(savedState); if (savedState != null) { onProcessRestart(); } restartableLatestCache(GET_MANGA, () -> Observable.just(manga), MangaInfoFragment::onNextManga); restartableLatestCache( GET_CHAPTER_COUNT, () -> Observable.just(count), MangaInfoFragment::setChapterCount); restartableFirst( FETCH_MANGA_INFO, this::fetchMangaObs, (view, manga) -> view.onFetchMangaDone(), (view, error) -> view.onFetchMangaError()); registerForStickyEvents(); }
@Override protected void onDestroy() { unregisterForEvents(); super.onDestroy(); }