0
私はすべてstackoverflowで試してみますが、広告は表示されません。バナーやその他の仕事がネイティブではありません。admobネイティブ・エクスプレス広告が表示されない
inal NativeExpressAdView mAdView2 = (NativeExpressAdView) findViewById(R.id.adView2);
// Set its video options.
mAdView2.setVideoOptions(new VideoOptions.Builder()
.setStartMuted(true)
.build());
// The VideoController can be used to get lifecycle events and info about an ad's video
// asset. One will always be returned by getVideoController, even if the ad has no video
// asset.
mVideoController = mAdView2.getVideoController();
mVideoController.setVideoLifecycleCallbacks(new VideoController.VideoLifecycleCallbacks() {
@Override
public void onVideoEnd() {
Log.d(LOG_TAG, "Video playback is finished.");
super.onVideoEnd();
}
});
// Set an AdListener for the AdView, so the Activity can take action when an ad has finished
// loading.
mAdView2.setAdListener(new AdListener() {
@Override
public void onAdLoaded() {
mAdView2.setVisibility(View.VISIBLE);
if (mVideoController.hasVideoContent()) {
Log.d(LOG_TAG, "Received an ad that contains a video asset.");
} else {
Log.d(LOG_TAG, "Received an ad that does not contain a video asset.");
}
}
});
mAdView2.loadAd(adRequest);
このアクティビティコード
これは、XMLコードです。私を助けてください。
<com.google.android.gms.ads.NativeExpressAdView
android:id="@+id/adView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adUnitId="ca-app-pub-000000"
ads:adSize="300x150"
android:visibility="gone"
>
</com.google.android.gms.ads.NativeExpressAdView>