Answers for "calling fragment from activity in kotlin"

3

open fragment from activity kotlin

if (savedInstanceState == null) {
            val f = DnsTestFragment()
            val t: FragmentTransaction = supportFragmentManager.beginTransaction()
            t.replace(binding.findastestFramelayout.id, f).commit()
        }
Posted by: Guest on August-17-2021
-2

how to start activity from fragment in kotlin

activity?.let{
    val intent = Intent (it, Main::class.java)
    it.startActivity(intent)
}
Posted by: Guest on February-15-2021

Code answers related to "calling fragment from activity in kotlin"

Browse Popular Code Answers by Language