public abstract class

NativeAdView

extends FrameLayout
java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.FrameLayout
         ↳ com.google.android.gms.ads.formats.NativeAdView
Known Direct Subclasses

Class Overview

The root view for all Google native ads.

Summary

[Expand]
Inherited Constants
From class android.view.ViewGroup
From class android.view.View
[Expand]
Inherited Fields
From class android.view.View
Public Constructors
NativeAdView(Context context)
Construct a NativeAdView from code.
NativeAdView(Context context, AttributeSet attrs)
Construct a NativeAdView from an XML layout.
NativeAdView(Context context, AttributeSet attrs, int defStyleAttr)
Construct a NativeAdView from an XML layout.
NativeAdView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
Construct a NativeAdView from an XML layout.
Public Methods
void destroy()
Destroy the native ad view.
AdChoicesView getAdChoicesView()
Returns the view associated with AdChoices content.
void setAdChoicesView(AdChoicesView adChoicesView)
Sets an AdChoicesView for displaying AdChoices content.
void setNativeAd(NativeAd ad)
Sets the NativeAd that this view is currently displaying.
[Expand]
Inherited Methods
From class android.widget.FrameLayout
From class android.view.ViewGroup
From class android.view.View
From class java.lang.Object
From interface android.view.ViewParent
From interface android.view.ViewManager
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.accessibility.AccessibilityEventSource

Public Constructors

public NativeAdView (Context context)

Construct a NativeAdView from code.

Parameters
context Context: The Context in which the NativeAdView is running.

public NativeAdView (Context context, AttributeSet attrs)

Construct a NativeAdView from an XML layout.

Parameters
context Context
attrs AttributeSet

public NativeAdView (Context context, AttributeSet attrs, int defStyleAttr)

Construct a NativeAdView from an XML layout.

Parameters
context Context
attrs AttributeSet
defStyleAttr int

public NativeAdView (Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)

Construct a NativeAdView from an XML layout.

Parameters
context Context
attrs AttributeSet
defStyleAttr int
defStyleRes int

Public Methods

public void destroy ()

Destroy the native ad view. No other methods should be called on the ad view after destroy() is called.

public AdChoicesView getAdChoicesView ()

Returns the view associated with AdChoices content.

Returns
AdChoicesView

public void setAdChoicesView (AdChoicesView adChoicesView)

Sets an AdChoicesView for displaying AdChoices content.

Parameters
adChoicesView AdChoicesView: The AdChoicesView to set

public void setNativeAd (NativeAd ad)

Sets the NativeAd that this view is currently displaying.

Parameters
ad NativeAd: the native ad that the view is currently displaying