Android 为什么我看不见我的间隙?
我正在尝试用hello world节目制作中间广告和横幅广告 横幅添加工作正常,但当我在emulator上打开我的decive时,Intercentralad没有出现 这是我的密码: Androidmainfaist:Android 为什么我看不见我的间隙?,android,ads,Android,Ads,我正在尝试用hello world节目制作中间广告和横幅广告 横幅添加工作正常,但当我在emulator上打开我的decive时,Intercentralad没有出现 这是我的密码: Androidmainfaist: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.za
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.zaki.adstrial" >
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<meta-data android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:theme="@android:style/Theme.Translucent"/>
</application>
</manifest>
activitymain.xml:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity">
<TextView android:text="@string/hello_world" android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
ads:adSize="BANNER"
ads:adUnitId="@string/banner_ad_unit_id">
</com.google.android.gms.ads.AdView>
</RelativeLayout>
问题在哪里
提前感谢您已经正确设置了
Interstitalad
,但您没有加载任何内容。您的adRequest2
仅加载横幅广告的数据,即mAdView
也就是说,你似乎也正确地为你的间隙设置了另一个AdRequest
;你可能只是忘记加载了。因此,您只需调用以下代码:
mInterstitialAd.loadAd(adRequest);
我想你刚刚忘了装插页广告 以前
AdRequest adRequest = new AdRequest.Builder().addTestDevice(
AdRequest.DEVICE_ID_EMULATOR).build();
之后
AdRequest adRequest = new AdRequest.Builder().addTestDevice(
AdRequest.DEVICE_ID_EMULATOR).build();
AdRequest adRequest = new AdRequest.Builder().addTestDevice(
AdRequest.DEVICE_ID_EMULATOR).build();
mInterstitialAd.loadAd(adRequest);