Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ActivityRetainedLifecycle to default bindings docs #4280

Closed
wants to merge 1 commit into from

Conversation

yschimke
Copy link

@yschimke yschimke commented Apr 5, 2024

Since this can be injected, seems like it's missing from docs.

Since this can be injected, seems like it's missing from docs.
@yschimke
Copy link
Author

yschimke commented Apr 5, 2024

Example

    @ActivityRetainedScoped
    @Provides
    fun providesCoroutineScope(
        activityRetainedLifecycle: ActivityRetainedLifecycle,
    ): CoroutineScope {
        return CoroutineScope(SupervisorJob() + Dispatchers.Default).also {
            activityRetainedLifecycle.addOnClearedListener {
                it.cancel()
            }
        }
    }

copybara-service bot pushed a commit that referenced this pull request Apr 11, 2024
Closes #4280

RELNOTES=n/a
PiperOrigin-RevId: 623660558
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.

None yet

1 participant