rememberCaptureMediaLauncher

Creates and remembers a launcher for capturing media (photo and/or video) using the device camera.

The contract's destination file paths are persisted via rememberSaveable so that captured media can be recovered after process death (e.g. "Don't keep activities").

Return

A ManagedActivityResultLauncher to launch the media capture activity.

Parameters

mode

The capture mode determining what media types can be captured.

onResult

Callback invoked when media capture completes successfully. Receives a File representing the captured media. Not called if the user cancels the capture.

See also