Skip to content
This repository was archived by the owner on Jun 1, 2024. It is now read-only.

Set FLAG_ACTIVITY_NEW_TASK on external link intents#2837

Merged
ccrama merged 1 commit into
Haptic-Apps:masterfrom
CometDog:bugfix/fix-crash-on-open-externally
Aug 14, 2018
Merged

Set FLAG_ACTIVITY_NEW_TASK on external link intents#2837
ccrama merged 1 commit into
Haptic-Apps:masterfrom
CometDog:bugfix/fix-crash-on-open-externally

Conversation

@CometDog

Copy link
Copy Markdown
Contributor

Call LinkUtil.openExternally from Website context external button

This is a hopeful fix for external intents crashing the app. I added the NEW_TASK flag to the intents since we're launching externally off of the application context, so the new context can't attach back to us.

Does this even make sense? I'm going to try to vet it out to at least one other person before deciding it works.

Call LinkUtil.openExternally from Website context external button
@CometDog CometDog mentioned this pull request Aug 13, 2018
@ccrama

ccrama commented Aug 14, 2018

Copy link
Copy Markdown
Collaborator

We used to do that, but removed it because it caused a lot of issues 😅

@ccrama

ccrama commented Aug 14, 2018

Copy link
Copy Markdown
Collaborator

How would that tag be fixing the crashing issues?

@CometDog

Copy link
Copy Markdown
Contributor Author

My hunch is that because I made a change to call the intent off of the application context, some devices/launchers are crashing when the intent tries to attach itself to the previous context given. If I use baseContext, that may be resolved since it's an activity context, but I'm not completely sure yet.

Flagging it for a new task should let the called intent open very discretely in the external app we call to open.

I'm only 20% sure about this until I get something back from the tester.

@CometDog

CometDog commented Aug 14, 2018

Copy link
Copy Markdown
Contributor Author

Both of the people I sent an APK off to seem to claim that this change fixed their external link handling issues @ccrama.

The other factor here is I'm sending off noGPlayDebug builds instead of the production APK. I have no reason to believe that that would affect this change.

Based on that I think it'd be reasonable to say this resolved it. Can you recall the issues this caused in the past?

@ccrama

ccrama commented Aug 14, 2018

Copy link
Copy Markdown
Collaborator

That is a very interesting idea, I think you are right! There should be no reason a debug build should affect it.

I will also push a new tag with this commit so F-Droid gets a new build ASAP!

@ccrama
ccrama merged commit ed9abf6 into Haptic-Apps:master Aug 14, 2018
@CometDog
CometDog deleted the bugfix/fix-crash-on-open-externally branch August 14, 2018 04:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants