No ActivityResultRegistryOwner was provided via LocalActivityResultRegistryOwner

  Kiến thức lập trình

I am writing a plugin for an app. I don’t have an access to activity context. In my compose view I am calling rememberLauncherForActivityResult but that crashes with

java.lang.IllegalStateException: No ActivityResultRegistryOwner was provided via LocalActivityResultRegistryOwner

Is there any way around this?

I found an older SO answer that gave me hopes that there might be a way around it, but it is not working for me. I replaced AmbientContext with LocalContext and that crashes with

my.package.ComposeContext cannot be cast to androidx.activity.result.ActivityResultRegistryOwner
// ComposeContext is just a ContextWrapper implementation to provide correct application context

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website

LEAVE A COMMENT