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.
Fixes https://github.com/xamarin/AndroidX/issues/873
The method
CustomTabsActivityManager.From (Activity parentActivity, string? servicePackageName = null)
caches the passed inparentActivity
forever, which can cause a memory leak.Additionally, only the first
parentActivity
passed in supported. SubsequentparentActivity
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.