Relative Content

Tag Archive for kotlin

mealMvvm = ViewModelProvider(this,viewModelFactory).get(MealViewModel::class.java)

<html>None of the following functions can be called with the arguments supplied:<br/>public constructor ViewModelProvider(store: ViewModelStore, factory: ViewModelProvider.Factory, defaultCreationExtras: CreationExtras = …) defined in androidx.lifecycle.ViewModelProvider<br/>public constructor ViewModelProvider(owner: ViewModelStoreOwner, factory: ViewModelProvider.Factory) defined in androidx.lifecycle.ViewModelProvider

Why can’t kotlin find determine the type? I think that’s enough

val mavenRepo = publishExtension.repositories.find { it is MavenArtifactRepository } if (mavenRepo != null) { println(“Repository URL:” + mavenRepo.url) } Just now, I wrote the code above. I think it works in theory. Or did I miss something? That’s the type of query I’m looking for, so why am I being asked to continue judging it […]