mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-06 03:50:19 +02:00
updated external library/bookmarks call logic
This commit is contained in:
parent
ca05831487
commit
72ea9adbf6
2 changed files with 27 additions and 16 deletions
|
@ -25,6 +25,8 @@ import android.content.Intent;
|
|||
import org.geometerplus.fbreader.book.SerializerUtil;
|
||||
import org.geometerplus.fbreader.fbreader.FBReaderApp;
|
||||
|
||||
import org.geometerplus.android.util.PackageUtil;
|
||||
|
||||
class ShowBookmarksAction extends FBAndroidAction {
|
||||
ShowBookmarksAction(FBReader baseActivity, FBReaderApp fbreader) {
|
||||
super(baseActivity, fbreader);
|
||||
|
@ -37,14 +39,18 @@ class ShowBookmarksAction extends FBAndroidAction {
|
|||
|
||||
@Override
|
||||
protected void run(Object ... params) {
|
||||
try {
|
||||
startBookmarksActivity(
|
||||
new Intent("android.fbreader.action.EXTERNAL_BOOKMARKS")
|
||||
);
|
||||
} catch (ActivityNotFoundException e) {
|
||||
startBookmarksActivity(
|
||||
new Intent(BaseActivity.getApplicationContext(), BookmarksActivity.class)
|
||||
);
|
||||
final Intent externalIntent =
|
||||
new Intent("android.fbreader.action.EXTERNAL_BOOKMARKS");
|
||||
final Intent internalIntent =
|
||||
new Intent(BaseActivity.getApplicationContext(), BookmarksActivity.class);
|
||||
if (PackageUtil.canBeStarted(BaseActivity, externalIntent, true)) {
|
||||
try {
|
||||
startBookmarksActivity(externalIntent);
|
||||
} catch (ActivityNotFoundException e) {
|
||||
startBookmarksActivity(internalIntent);
|
||||
}
|
||||
} else {
|
||||
startBookmarksActivity(internalIntent);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue