package com.xd.threadviewmodelstartercode

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.fragment.app.Fragment

class MainActivity : AppCompatActivity() {
    lateinit var myFragment: Fragment

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
//        setContentView(R.layout.activity_main)

        if (supportFragmentManager.findFragmentByTag("myfragment") == null) {
            myFragment = MyFragment()
            supportFragmentManager.beginTransaction().add(android.R.id.content, myFragment, "myfragment").commit()
        }
    }
}