Prajeet Shrestha:
J'ai un code Kotlin:
fun showAdWithCallback(callback:() -> Unit) {
if (AdsPrefs.shouldShowInterstitialAd()) {
mInterstitialAd.show()
this.callback = callback
} else {
callback()
}
}
Maintenant, je veux appeler cette méthode à partir d'une classe Java. Je suis confus sur la façon d'appeler cela. Voici ce que j'ai essayé
showAdWithCallback(() -> {
return null;
});
Mais il montre l'erreur suivante.
Bartek Lipinski:
Le message d'erreur est causée par le code avant votre:
showAdWithCallback(() -> {
return null;
});