moko-geo icon indicating copy to clipboard operation
moko-geo copied to clipboard

Couldn't use with ComponentActivity, bind issue

Open prabinshrestha opened this issue 8 months ago • 0 comments

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

prabinshrestha avatar Jun 27 '24 06:06 prabinshrestha