private void onPreferencesUpdate(int resultCode) { final FBReaderApp fbReader = (FBReaderApp) FBReaderApp.Instance(); switch (resultCode) { case RESULT_DO_NOTHING: break; case RESULT_REPAINT: { AndroidFontUtil.clearFontCache(); final BookModel model = fbReader.Model; if (model != null) { final Book book = model.Book; if (book != null) { book.reloadInfoFromDatabase(); ZLTextHyphenator.Instance().load(book.getLanguage()); } } fbReader.clearTextCaches(); fbReader.getViewWidget().repaint(); break; } case RESULT_RELOAD_BOOK: fbReader.reloadBook(); break; } }
@Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { final FBReaderApp fbreader = (FBReaderApp) FBReaderApp.Instance(); switch (requestCode) { case REPAINT_CODE: { final BookModel model = fbreader.Model; if (model != null) { final Book book = model.Book; if (book != null) { book.reloadInfoFromDatabase(); ZLTextHyphenator.Instance().load(book.getLanguage()); } } fbreader.clearTextCaches(); fbreader.getViewWidget().repaint(); break; } case CANCEL_CODE: fbreader.runCancelAction(resultCode - 1); break; } }