1
0
Fork 0
mirror of https://github.com/geometer/FBReaderJ.git synced 2025-10-05 10:49:24 +02:00

open book from bookmarks view

This commit is contained in:
Nikolay Pultsin 2013-01-20 12:43:50 +04:00
parent f17d1f127f
commit a9d948322c
2 changed files with 44 additions and 52 deletions

View file

@ -34,7 +34,6 @@ import org.geometerplus.zlibrary.core.options.ZLStringOption;
import org.geometerplus.zlibrary.ui.android.R;
import org.geometerplus.fbreader.book.*;
import org.geometerplus.fbreader.fbreader.FBReaderApp;
import org.geometerplus.fbreader.library.Library;
import org.geometerplus.android.util.UIUtil;
@ -228,19 +227,11 @@ public class BookmarksActivity extends TabActivity implements MenuItem.OnMenuIte
private void gotoBookmark(Bookmark bookmark) {
bookmark.onOpen();
final FBReaderApp fbreader = (FBReaderApp)FBReaderApp.Instance();
final long bookId = bookmark.getBookId();
if ((fbreader.Model == null) || (fbreader.Model.Book.getId() != bookId)) {
final Book book = Book.getById(bookId);
if (book != null) {
finish();
fbreader.openBook(book, bookmark, null);
} else {
UIUtil.showErrorMessage(this, "cannotOpenBook");
}
final Book book = Book.getById(bookmark.getBookId());
if (book != null) {
FBReader.openBookActivity(this, book, bookmark);
} else {
finish();
fbreader.gotoBookmark(bookmark);
UIUtil.showErrorMessage(this, "cannotOpenBook");
}
}