1

i want to show BottomSheetDialog in component activity but in that im not able to find supportFragmentManager.

class MainActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContent {
            MyApplicationTheme {
                Column(
                    horizontalAlignment = Alignment.CenterHorizontally,
                    modifier = Modifier.fillMaxWidth()
                ) {
                    Text(
                        "Hello World",
                        fontSize = 30.sp,
                        modifier =
                            modifier.clickable {
                                val bottomSheet = BottomSheetDialog()
                                bottomSheet.show(supportFragmentManager, "ModalBottomSheet")
                            }
                    )
                }
            }
        }
    }
}

0 Answers0