コードにエラーは表示されません。
main.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.google.ads.AdView android:id="@+id/googleads"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adUnitId="jkdfj8485idj34"
ads:adSize="BANNER"
ads:refreshInterval="60"
ads:loadAdOnCreate="true"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="AD" />
</LinearLayout>
AdmobActivity.java
AdView ad = (AdView)findViewById(R.id.googleads);
ad.setEnabled(true);
ad = new AdView(this, AdSize.BANNER, MY_BANNER_UNIT_ID);
AdRequest r = new AdRequest();
//r.addTestDevice(AdRequest.TEST_EMULATOR);
r.addTestDevice("CD9E4FDFA47A4AA03F9883E77C036EB3");
//r.setTesting(true);
ad.loadAd(r);
次の警告があります。
07-26 15:51:24.046: W/webcore(842): 最初のレイアウトの後に viewWidth を取得できません 07-26 15:51:24.871: W/Ads(842): 無効な不明な要求エラー: 要求を特定できませんタイプ。広告ユニット ID は正しいですか?
私を助けてください。