public class NativeImageHelper
Collection of helper methods to assist with image download and display. Intended for mediation adapter implementations only. Refer to our adapter building instructions for native ads for additional implementation instructions. Do not call this class or associated methods from your app.
public static void /loadImageView(String url, ImageView imageView) /+4.0.0
Description: Helper method that takes an image URL and loads the image into an image view.
url: The image URL.
imageView: The image view into which to load the image.
public static void /preCacheImages(Context context, List<String> imageUrls, ImageListener imageListener) /+4.0.0
Description: Pre-caches the given set of image URLs. We recommend using this method to warm the image cache before calling
CustomEventNative.CustomEventNativeListener.onNativeAdLoaded(com.mopub.nativeads.BaseNativeAd). Doing so will force images to cache before displaying the ad.
context: The current context.
imageUrls: A String List of image URLs to be downloaded.
imageListener: Callbacks to inform whether the image downloading has succeeded (via
ImageListener.onImagesCached()) or not (via
How can we make this article better for you?
Last updated July 14, 2021
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.
© 2021 MoPub (a division of Twitter, Inc.)