Skip to content

Commit 70f5a8d

Browse files
committed
android: add intents for ReaderAction (e.g.: org.coolreader.cmd.PAGE_UP)
1 parent 0a6dd32 commit 70f5a8d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

android/src/org/coolreader/CoolReader.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,16 @@ private boolean processIntent(Intent intent) {
747747
if (uri != null) {
748748
fileToOpen = filePathFromUri(uri);
749749
}
750+
} else {
751+
for (ReaderAction ra: ReaderAction.AVAILABLE_ACTIONS) {
752+
String raIntentName = "org.coolreader.cmd." + ra.id;
753+
if (raIntentName.equals(intent.getAction())) {
754+
mReaderView.onCommand(ra.cmd, ra.param, null);
755+
return true;
756+
}
757+
}
750758
}
759+
751760
if (fileToOpen == null && intent.getExtras() != null) {
752761
log.d("extras=" + intent.getExtras());
753762
fileToOpen = intent.getExtras().getString(OPEN_FILE_PARAM);

0 commit comments

Comments
 (0)