mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-06 03:50:19 +02:00
fbreader intents cleanup
This commit is contained in:
parent
804cb4d400
commit
b0f0261b9e
18 changed files with 148 additions and 106 deletions
|
@ -22,7 +22,6 @@ package org.geometerplus.android.fbreader;
|
|||
import android.content.ActivityNotFoundException;
|
||||
import android.content.Intent;
|
||||
|
||||
import org.geometerplus.fbreader.book.SerializerUtil;
|
||||
import org.geometerplus.fbreader.fbreader.FBReaderApp;
|
||||
|
||||
import org.geometerplus.android.util.PackageUtil;
|
||||
|
@ -40,7 +39,7 @@ class ShowBookmarksAction extends FBAndroidAction {
|
|||
@Override
|
||||
protected void run(Object ... params) {
|
||||
final Intent externalIntent =
|
||||
new Intent("android.fbreader.action.EXTERNAL_BOOKMARKS");
|
||||
new Intent(FBReaderIntents.Action.EXTERNAL_BOOKMARKS);
|
||||
final Intent internalIntent =
|
||||
new Intent(BaseActivity.getApplicationContext(), BookmarksActivity.class);
|
||||
if (PackageUtil.canBeStarted(BaseActivity, externalIntent, true)) {
|
||||
|
@ -55,12 +54,8 @@ class ShowBookmarksAction extends FBAndroidAction {
|
|||
}
|
||||
|
||||
private void startBookmarksActivity(Intent intent) {
|
||||
intent.putExtra(
|
||||
FBReader.BOOK_KEY, SerializerUtil.serialize(Reader.Model.Book)
|
||||
);
|
||||
intent.putExtra(
|
||||
FBReader.BOOKMARK_KEY, SerializerUtil.serialize(Reader.createBookmark(20, true))
|
||||
);
|
||||
FBReaderIntents.putBookExtra(intent, Reader.Model.Book);
|
||||
FBReaderIntents.putBookmarkExtra(intent, Reader.createBookmark(20, true));
|
||||
OrientationUtil.startActivity(BaseActivity, intent);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue