I have a Kotlin Code:
fun showAdWithCallback(callback:() -> Unit) {
if (AdsPrefs.shouldShowInterstitialAd()) {
mInterstitialAd.show()
this.callback = callback
} else {
callback()
}
}
Now I want to call this method from a Java Class. I am confused about how to call this. Here is what I tried
showAdWithCallback(() -> {
return null;
});
But it shows following error.