示例#1
0
  @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();
  }
示例#2
0
 @Override
 protected void onDestroy() {
   unregisterForEvents();
   super.onDestroy();
 }