I tried to set the adListener for Interstitial Ad but it doesn't work (AdMob + Kotlin - Mobile Ads Garage #13). After a bit digging I found that the methods adListener is deprecated, and is replaced with Instertitial Ad.load. I really don't know how to set a listener on ad this way(??) and I have searched all over the internet to find a solution for this. Please help. Thank you.
Edit: I want to navigate to new fragment when the Instertitial Ad is dismissed (closed), so I tried:
private fun showInterstitial() {
mInterstitialAd?.fullScreenContentCallback = object : FullScreenContentCallback() {
override fun onAdDismissedFullScreenContent() {
Log.d(TAG, "Ad was dismissed.")
// Don't forget to set the ad reference to null so you
// don't show the ad a second time.
mInterstitialAd = null
view?.findNavController()?.navigate(action)
}
override fun onAdFailedToShowFullScreenContent(adError: AdError?) {
Log.d(TAG, "Ad failed to show.")
// Don't forget to set the ad reference to null so you
// don't show the ad a second time.
mInterstitialAd = null
view?.findNavController()?.navigate(action)
}
override fun onAdShowedFullScreenContent() {
Log.d(TAG, "Ad showed fullscreen content.")
view?.findNavController()?.navigate(action)
}
}
mInterstitialAd?.show(this.activity)}
and It doesn't work.
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)