MainActivity.kt
The snippet can be accessed without any authentication.
Authored by
a6-alrashdi
MainActivity.kt 814 B
package com.example.match
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.lifecycle.viewmodel.compose.viewModel
import com.example.match.ui.home.HomeViewModel
import com.example.match.ui.theme.MatchTheme
import dagger.hilt.android.AndroidEntryPoint
@AndroidEntryPoint
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
val viewModel: HomeViewModel = viewModel()
viewModel.fetchTopLeaguesMatches()
viewModel.fetchLiveScores()
viewModel.fetchUpcomingMatches()
MatchTheme {
AppNavHost()
}
}
}
}
Please register or sign in to comment