package com.xd.threadviewmodelkotlin

import android.os.Bundle
import android.widget.ArrayAdapter
import android.widget.ListView
import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.Fragment
import androidx.lifecycle.Observer
import androidx.lifecycle.ViewModelProvider
import java.util.*

class MainActivity : AppCompatActivity() {
    private 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()
        }

    }
}