这很难说肯定没有看到你的代码,你的布局,但这里有一些东西,你可能要检查:
1)AdMobActivity宣布在AndroidManifest:
2)你要求INTERNET权限在AndroidManifest:
<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!");
}
你能提供的崩溃日志?该笔记是正常的。 – 2011-01-11 03:43:12
01-10 20:20:11.152:ERROR/AndroidRuntime(2043):at com.admob.android.ads.AdView。(AdView.java:323) 01-10 20:20:11.152:ERROR/AndroidRuntime(2043):at com.admob.android.ads.AdView。 (AdView.java:308) 01-10 20:20:11.152:ERROR/AndroidRuntime(2043):at com.admob.android.ads.AdView。 (AdView.java:267) 对不起,以前从未发布过日志... –
semajhan
2011-01-11 03:50:24