Skip to content

[AndroidX.Browser] Obsolete CustomTabsActivityManager.From with message describing its shortcomings.#874

Merged
jpobst merged 2 commits into
mainfrom
customtabs-obsolete
Apr 22, 2024
Merged

[AndroidX.Browser] Obsolete CustomTabsActivityManager.From with message describing its shortcomings.#874
jpobst merged 2 commits into
mainfrom
customtabs-obsolete

Conversation

@jpobst
Copy link
Copy Markdown
Contributor

@jpobst jpobst commented Apr 16, 2024

Fixes #873

The method CustomTabsActivityManager.From (Activity parentActivity, string? servicePackageName = null) caches the passed in parentActivity forever, which can cause a memory leak.

Additionally, only the first parentActivity passed in supported. Subsequent parentActivity arguments are ignored and the first one is always reused.

Mark this helper method as [Obsolete] and recommend consumers implement any desired caching themselves in a way that respects the parent activity(ies) and their lifetimes properly for the relevant application.

@jpobst jpobst marked this pull request as ready for review April 17, 2024 01:21
@jpobst jpobst requested a review from moljac April 17, 2024 17:16
@jpobst jpobst merged commit 27ff690 into main Apr 22, 2024
@jpobst jpobst deleted the customtabs-obsolete branch April 22, 2024 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue with CustomTabsActivityManager and multiple activities

2 participants