Skip to content
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

Couldn't use with ComponentActivity, bind issue #48

Closed
prabinshrestha opened this issue Jun 27, 2024 · 1 comment · Fixed by #50
Closed

Couldn't use with ComponentActivity, bind issue #48

prabinshrestha opened this issue Jun 27, 2024 · 1 comment · Fixed by #50
Milestone

Comments

@prabinshrestha
Copy link

I am using 0.6.0 library integrated for my multiplatform project and found out it doesnot work with ComponentActivity.

MainActivity which extends ComponentActivity(from official android) cannot be cast to androidx.fragment.app.FragmentActivity

fun BindMyLocationTrackerEffect(locationTracker: LocationTracker) {
val lifecycleOwner: LifecycleOwner = LocalLifecycleOwner.current
val context: Context = LocalContext.current

LaunchedEffect(locationTracker, lifecycleOwner, context) {
    val fragmentManager: FragmentManager = (context as FragmentActivity).supportFragmentManager // this part has an issue
    locationTracker.bind(lifecycleOwner.lifecycle, context, fragmentManager)
}

}

the current solution is to use AppCompatActivity but i want to utilize latest ComponentActivity from android

@Alex009
Copy link
Member

Alex009 commented Sep 22, 2024

will be released in 0.7.0

@Alex009 Alex009 closed this as completed Sep 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants