Created
January 31, 2023 11:17
-
-
Save tdcolvin/a2d7bea1a2f193b5f243b0a5910d677e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Button( | |
onClick = { | |
//On button press, launch the photo picker | |
launcher.launch(PickVisualMediaRequest( | |
//Here we request only photos. Change this to .ImageAndVideo if | |
//you want videos too. | |
//Or use .VideoOnly if you only want videos. | |
mediaType = ActivityResultContracts.PickVisualMedia.ImageOnly | |
)) | |
} | |
) { | |
Text("Select Photo") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment