Код: Выделить всё
class MainActivity : AppCompatActivity() {
private lateinit var mAuth: FirebaseAuth
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
mAuth = FirebaseAuth.getInstance()
val currentUser = mAuth.currentUser
if (currentUser != null) {
val intent = Intent(this@MainActivity, HomeActivity::class.java)
startActivity(intent)
} else{
val signIn = EmailSignIn()
supportFragmentManager.beginTransaction().apply {
replace(R.id.logFragment, signIn)
commit()
}
}
}
Подробнее здесь: https://stackoverflow.com/questions/783 ... g-executed