Skip to end of metadata
Go to start of metadata

AdListener

JavaScript is disabled on your browser.
com.appnexus.opensdk

Interface AdListener



  • public interface AdListener
    Implement this interface and pass it to your BannerAdView and InterstitialAdView objects to receive events on the status of the ad.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method and Description
      void onAdClicked(AdView adView)
      Called when the ad being clicked and the ClickThroughAction is set as either ANClickThroughAction.OPEN_DEVICE_BROWSER or ANClickThroughAction.OPEN_SDK_BROWSER.
      void onAdClicked(AdView adView, java.lang.String clickUrl)
      Called when an ad is clicked and the ANClickThroughAction is set to ANClickThroughAction.RETURN_URL.
      void onAdCollapsed(AdView adView)
      Called when an ad is closed/unexpanded, for example if the user has stopped interacting with the ad.
      void onAdExpanded(AdView adView)
      Called when an ad expands due to user interaction.
      void onAdLoaded(AdView adView)
      Called when an ad has successfully been loaded from the server.
      void onAdLoaded(NativeAdResponse nativeAdResponse)
      Called when an ad has successfully been loaded from the server.
      void onAdRequestFailed(AdView adView, ResultCode errorCode)
      Called when an ad request has failed.
    • Method Detail

      • onAdLoaded

        void onAdLoaded(AdView adView)
        Called when an ad has successfully been loaded from the server.
        Parameters:
        adView - The AdView that loaded the ad.
      • onAdLoaded

        void onAdLoaded(NativeAdResponse nativeAdResponse)
        Called when an ad has successfully been loaded from the server.
        Parameters:
        nativeAdResponse - The NativeAdResponse that loaded the ad.
      • onAdRequestFailed

        void onAdRequestFailed(AdView adView,
                               ResultCode errorCode)
        Called when an ad request has failed. Ad requests can fail because no ad is available, or because of networking errors.
        Parameters:
        adView - The AdView that loaded the ad.
        errorCode - the error code describing the failure.
      • onAdExpanded

        void onAdExpanded(AdView adView)
        Called when an ad expands due to user interaction. MRAID ads that expand the screen generate these events, for example. This event may fire from both banner and interstitial ads. This would be a good time to stop or pause your application due to the user interacting with the ad. This is the inverse of onAdCollapsed.
        Parameters:
        adView - The AdView that loaded the ad.
      • onAdCollapsed

        void onAdCollapsed(AdView adView)
        Called when an ad is closed/unexpanded, for example if the user has stopped interacting with the ad. This is the inverse of onAdExpanded.
        Parameters:
        adView - The AdView that loaded the ad.
      • onAdClicked

        void onAdClicked(AdView adView)
        Called when the ad being clicked and the ClickThroughAction is set as either ANClickThroughAction.OPEN_DEVICE_BROWSER or ANClickThroughAction.OPEN_SDK_BROWSER. ANClickThroughAction The current activity will be paused as the user switches to the activity launched from the ad interaction. For example, the user may click a link that opens a web browser, or touch a click-to-call link which launches the phone dialer.
        Parameters:
        adView - The AdView that loaded the ad.
      • onAdClicked

        void onAdClicked(AdView adView,
                         java.lang.String clickUrl)
        Called when an ad is clicked and the ANClickThroughAction is set to ANClickThroughAction.RETURN_URL. ANClickThroughAction
        Parameters:
        adView - The AdView that loaded the ad.

  • No labels