I am facing an issue in my Android app where I'm unable to use supportFragmentManager in my ComponentActivity subclass. As per my understanding, ComponentActivity does not support the FragmentManager out of the box. And if I want to use supportFragmentManager Activity should be subclasses of AppCompatActivity or FragmentActivity. However, I'm encountering a problem where it seems to be unavailable. I want to use both JetPack Compose and XML in my class,
I have followed this https://mcmap.net/q/327239/-android-jetpack-compose-and-xml-in-activity
class AbcActivity : ComponentActivity(n) {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_permissio)
if (savedInstanceState == null) {
// Here I want to use supposrtFragmentManger
}
}
}
Gradle file look like this,
dependencies {
implementation("androidx.core:core-ktx:1.12.0")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.2")
implementation("androidx.activity:activity-compose:1.8.0")
..
}
Any idea to use both JetPack Compose and XML in same class in a way I could use fragment Manager?