AdapterHelper

public final class AdapterHelper

A helper class to retrieve a native ad for a manual integration.

Public Methods

public View /getAdView(View convertView, ViewGroup parent, NativeAd nativeAd)

  • Description: Returns a fully populated view containing the rendered ad content. The view has a click listener attached to it and will automatically handle opening the ad’s destination URL. It will also track impressions and clicks automatically.

  • Parameters:

    • convertView: And old view to reuse. If null, a new view will be inflated from XML.
    • parent: The optional parent view that provides the correct subclass of LayoutParams for the root view’s XML.
    • nativeAd: The native ad returned by the MoPub SDK. If this is null, the view returned will have its visibility set to View.GONE.

public View /getAdView(View convertView, ViewGroup parent, NativeAd nativeAd, ViewBinder viewBinder)

  • Description: Returns a fully populated view containing the rendered ad content. The view has a click listener attached to it and will automatically handle opening the ad’s destination URL. It will also track impressions and clicks automatically.

  • Parameters:

    • convertView: And old view to reuse. If null, a new view will be inflated from XML.
    • parent: The optional parent view that provides the correct subclass of LayoutParams for the root view’s XML.
    • nativeAd: The native ad returned by the MoPub SDK. If this is null, the view returned will have its visibility set to View.GONE.
    • viewBinder: Any non-null view binder.

Last updated March 03, 2020

TWITTER, MOPUB, and the Bird logo are trademarks of Twitter, Inc. or its affiliates. All third party logos and trademarks included are the property of their respective owners.

© 2020 MoPub (a division of Twitter, Inc.)