I need to call this function to show an interstitial ad from a button click inside a composable function, which expects an activity for the show() method:
fun showInterstitial() {
if (mInterstitialAd != null) {
mInterstitialAd?.show(this)
} else {
Log.d("MainActivity", "The interstitial ad wasn't ready yet.")
}
}
How can I get the current activity and replace the this part?
Thanks for your answer!