Skip to content
This repository was archived by the owner on Feb 10, 2023. It is now read-only.

Commit a6ad692

Browse files
committed
fix(Action-Error): Solve Android action error
1 parent 88579aa commit a6ad692

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

urlhandler.android.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ export function handleIntent(intent: any) {
2424
application.android.on(application.AndroidApplication.activityCreatedEvent, (args) => {
2525
let intent: android.content.Intent = args.activity.getIntent();
2626
try {
27-
if (new String(intent.getAction()).valueOf() === new String(android.content.Intent.ACTION_VIEW).valueOf()) {
27+
if (new String(intent.getAction()).valueOf() === new String(android.content.Intent.ACTION_MAIN).valueOf()
28+
|| new String(intent.getAction()).valueOf() === new String(android.content.Intent.ACTION_VIEW).valueOf()) {
2829
handleIntent(intent);
2930
}
3031
} catch (e) {
@@ -35,7 +36,8 @@ application.android.on(application.AndroidApplication.activityCreatedEvent, (arg
3536
application.android.on(application.AndroidApplication.activityResumedEvent, (args) => {
3637
let intent: android.content.Intent = args.activity.getIntent();
3738
try {
38-
if (new String(intent.getAction()).valueOf() === new String(android.content.Intent.ACTION_VIEW).valueOf()) {
39+
if (new String(intent.getAction()).valueOf() === new String(android.content.Intent.ACTION_MAIN).valueOf()
40+
|| new String(intent.getAction()).valueOf() === new String(android.content.Intent.ACTION_VIEW).valueOf()) {
3941
handleIntent(intent);
4042
lastReceivedData = intent.getData();
4143
}

0 commit comments

Comments
 (0)