Hi guys. I have a question about about Android Vie...
# android
a
Hi guys. I have a question about about Android ViewModelScope. I have created a new class.
Copy code
class MainViewModel : ViewModel() {
    var pokemonList = MutableLiveData<List<Pokemon>>()
    val pokemonService = PokemonService.retrofitBuilder

    init {
        callPokemonApi()
    }

    fun callPokemonApi() {
        viewModelScope.launch {
            val resultOne = async {
                val result = pokemonService.getPokemonList("1572848655474")
                for (single in result) {
                    Log.d("Pokemon", single.pokemonName)
                }
            }.await()
        }
    }
}