-
Notifications
You must be signed in to change notification settings - Fork 12
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
How usage moko-media and moko-permissions in now update compose multiplatform. Resolve Fragment Activity bugs #75
Comments
I am having the same problem when I use
and when I use
I am trying the same code from the documentation @Composable
fun Sample() {
val mediaFactory = rememberMediaPickerControllerFactory()
val mediaPicker = remember(mediaFactory) { mediaFactory.createMediaPickerController() }
val factory: PermissionsControllerFactory = rememberPermissionsControllerFactory()
val controller: PermissionsController = remember(factory) { factory.createPermissionsController() }
val coroutineScope: CoroutineScope = rememberCoroutineScope()
BindEffect(controller)
BindMediaPickerEffect(mediaPicker)
Button(
onClick = {
coroutineScope.launch {
controller.providePermission(Permission.GALLERY)
val bitmap = mediaPicker.pickImage(MediaSource.GALLERY)
}
}
) {
Text(text = "Test")
}
} |
I'm getting the same error as @orelvis15, is there a solution? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was having trouble launching the gallery in cross-platform composition on the Android platform. My problem is that the fragment activity was not initialized when entering the screen with the
BindMediaPickerEffect(mediaPicker)
method. Solve this problem when change inComposableActivity()
toFragmentActivity()
inMainActivity.kt
MainActivity.kt in android package
How to usage moko-media and moko-permissions in compose multiplatform 2024
To use
moko-media
andmoko-permissions
in cross-platform composition, follow the steps below:in ViewModel, this function usage to open gallary and manipulate show image selected in your screen
The text was updated successfully, but these errors were encountered: