Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Request for new functionality
View staffing
Description
Component used: Activity
Version used: 1.5.0-alpha02
AndroidX Activity's
ComponentActivity
implements a number of interfaces suffixed withProvider
that allow any component to receive callbacks for when the related method on Activity is called:OnNewIntentProvider
OnConfigurationChangedProvider
OnTrimMemoryProvider
OnMultiWindowModeChangedProvider
OnPictureInPictureModeChangedProvider
Right now, these are simply
add
andremove
methods for each callback. It would be nice if there was also aLifecycle
aware version ofadd
that would automatically remove itself when the Lifecycle drops below a givenminState
.This would help prevent memory leaks where a developer calls
add
, but forgets to later callremove
.Ideally, these are located alongside/as a part of the interfaces themselves and not specifically tied to
androidx.activity
.