2014-01-14 60 views
0

我找到了教程和解決方案,但我仍然不知道如何顯示我的admob廣告。我的admob廣告沒有顯示

它只是顯示webview和下面的白色區域。

以下是我在webview下面顯示admob的活動。

我這樣做是符合YouTube教程http://www.youtube.com/watch?v=AzTFkpIj2L4

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:tools="http://schemas.android.com/tools" 
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads" 
android:id="@+id/linearLayout" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:paddingBottom="@dimen/activity_vertical_margin" 
android:paddingLeft="@dimen/activity_horizontal_margin" 
android:paddingRight="@dimen/activity_horizontal_margin" 
android:paddingTop="@dimen/activity_vertical_margin" 
tools:context=".ContentActivity" > 
<WebView 
    android:id="@+id/webview_content" 
    android:layout_width="fill_parent" 
    android:layout_height="200dp" 
    android:layout_alignParentTop="true" /> 
<com.google.ads.AdView 
    android:id="@+id/adView" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:layout_alignParentBottom="true" 
    android:layout_below="@id/webview_content" 
    ads:adSize="BANNER" 
    ads:adUnitId="a1526xxxxxadunitidxxxxe141f8" 
    ads:loadOnCreate="true" 
    ads:testDevices="DEVICE_ID" > 
</com.google.ads.AdView> 

感謝

+0

顯示您的清單 –

回答

0

清單檔案中的

<activity android:name="com.google.ads.AdActivity"   
      android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" /> 
+0

我有清單中的這行。 –

+0

然後顯示代碼,你是這個xml佈局 –

+0

它變成標記和低於2的活動「主要活動」和「內容活動」,是不是? –

0

上手尋找一個好地方添加以下代碼admob文檔。 https://developers.google.com/mobile-ads-sdk/docs/

+0

你能指導我清晰嗎?謝謝 –

+0

我試了很多次這個教程,但之前有錯誤 –

+0

好的,我會再試一次這個教程 –