Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I want to clarify how each flow works:
CustomTabs are meant to be open within the app. The NEW_TASK flag should not be used on that case. Of course I wasn't aware of this behavior until we required to pause the activity to get some data from an external app, like gmail.
For the Browser intent logic, which is only used in the case of calling
showUrl
from a non-activity class, the NEW_TASK flag is required as the context used is the Application one instead of the Activity one. If this flag is not provided a runtime exception raises. Browser is "still used" when going through the CustomTabs logic and no CustomTabs compatible browser app is installed in the device.The NO_HISTORY flag introduced in a previous commit to avoid leaving the browser app in the "recents app" view doesn't work as expected. Instead, it's making the custom tab or browser session refresh the webpage on the activity resume. I've removed both flags and might be worth checking this sdk line as well.
This fixes #124