Class InterstitialAd

  • All Implemented Interfaces:
    com.yandex.mobile.ads.fullscreen.FullScreenAdvertisable, com.yandex.mobile.ads.html.BaseAdvertisable

    @MainThread
    public final class InterstitialAd
    extends com.yandex.mobile.ads.fullscreen.FullScreenAd
    Full-screen interstitial ads.
    • Field Summary

      • Fields inherited from class com.yandex.mobile.ads.fullscreen.FullScreenAd

        FAILED_TO_SHOW_NOT_LOADED_AD, NOT_ACTIVITY_CONTEXT_WARNING
    • Constructor Summary

      Constructors 
      Constructor Description
      InterstitialAd​(android.content.Context context)
      Constructs a new InterstitialAd programmatically.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void destroy()
      Destroys this InterstitialAd entirely and cleans up resources.
      boolean isLoaded()
      Returns true if this interstitial ad has been successfully loaded and is ready to be shown, otherwise false.
      void loadAd​(com.yandex.mobile.ads.common.AdRequest adRequest)
      Starts loading the ad by AdRequest on a background thread.
      void setAdUnitId​(java.lang.String adUnitId)
      Sets a valid ad unit ID.
      void setInterstitialAdEventListener​(InterstitialAdEventListener interstitialAdEventListener)
      void show()
      Shows the interstitial ad, only if it has been loaded.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • InterstitialAd

        public InterstitialAd​(@NonNull
                              android.content.Context context)
        Constructs a new InterstitialAd programmatically.
        Parameters:
        context - The activity context the view is running in, through which it can access the current theme, resources, etc. In particular, it uses the window manager and theme in this context to present its UI.
    • Method Detail

      • setAdUnitId

        public void setAdUnitId​(@NonNull
                                java.lang.String adUnitId)
        Sets a valid ad unit ID. Ad unit ID can be set only once.
        Parameters:
        adUnitId - Unique ad placement ID created at partner interface. Example: R-M-DEMO-240x400-context.
      • loadAd

        public void loadAd​(@NonNull
                           com.yandex.mobile.ads.common.AdRequest adRequest)
        Starts loading the ad by AdRequest on a background thread. NOTE: The ad unit id must be set before that.
        Parameters:
        adRequest - AdRequest
      • show

        public void show()
        Shows the interstitial ad, only if it has been loaded.
      • isLoaded

        public boolean isLoaded()
        Returns true if this interstitial ad has been successfully loaded and is ready to be shown, otherwise false.
        Returns:
        true if this interstitial ad has been successfully loaded and is ready to be shown.
      • destroy

        public void destroy()
        Destroys this InterstitialAd entirely and cleans up resources. NOTE: Don't work with this InterstitialAd thereafter.