Package 

Class CaptureMediaLauncherKt

    • Method Summary

      Modifier and Type Method Description
      final static ManagedActivityResultLauncher<Unit, File> rememberCaptureMediaLauncher(Boolean photo, Boolean video, Function1<File, Unit> onResult) Creates and remembers a process-death-safe launcher for capturing media (photo and/or video) using the device camera.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • rememberCaptureMediaLauncher

        @Composable() final static ManagedActivityResultLauncher<Unit, File> rememberCaptureMediaLauncher(Boolean photo, Boolean video, Function1<File, Unit> onResult)

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

        Destination file paths are persisted via rememberSaveable. When the hosting activity is destroyed and recreated (e.g. under "Don't keep activities"), the paths are restored on the CaptureMediaContract before the pending result is delivered, ensuring the captured file is correctly resolved.

        Parameters:
        photo - If true, enables photo capture capability.
        video - If true, enables video capture capability.
        onResult - Callback invoked when media capture completes successfully.