在没有看到代码和布局的情况下很难确定地说,但是您可能需要检查以下几件事:
1)在您的AndroidManifest中声明了AdMobActivity:
<activity android:name="com.admob.android.ads.AdMobActivity"android:theme="@android:style/Theme.NoTitleBar.Fullscreen"android:configChanges="orientation|keyboard|keyboardHidden" />
2)您在AndroidManifest中请求INTERNET权限:
<uses-permission android:name="android.permission.INTERNET" />
3)您的attrs.xml文件包含必要的样式:
<?xml version="1.0" encoding="utf-8"?><resources> <declare-styleable name="com.admob.android.ads.AdView"> <attr name="backgroundColor" format="color" /> <attr name="primaryTextColor" format="color" /> <attr name="secondaryTextColor" format="color" /> <attr name="keywords" format="string" /> <attr name="refreshInterval" format="integer" /> </declare-styleable></resources>
4)您的AdView包含在您的布局中:
<com.admob.android.ads.AdView android:id="@+id/ad" android:layout_width="fill_parent" android:layout_height="wrap_content" myapp:backgroundColor="#000000" myapp:primaryTextColor="#FFFFFF" myapp:secondaryTextColor="#CCCCCC"/>
5)可以正确找到您的AdView:
AdView adView = (AdView)findViewById(R.id.ad);if (adView == null) { Log.e(TAG, "AdView not found!");}


