问题描述
我已经遵循Admob教程的所有步骤,但是当我运行我的应用程序而不是横幅时,"您必须在Androidmanifest.xml中用ConfigChanges"
中的androidmanifest.xml中声明的adactivity我的androidmanifest是:
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="it.gmg.android.fpg" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="8" /> <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" > <activity android:label="@string/app_name" android:name=".FPGActivity" > <intent-filter > <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name="com.google.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation"/> </application> <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> </manifest>
我认为一切都是正确的,为什么我无法展示横幅?
最好的问候
推荐答案
您缺少ADMOB AdActivity的configChanges属性中的一些条目 - 请参阅Google的描述这里.这也可能导致您更改构建目标.阅读我的详细答案驱动程序实现错误
问题描述
I have follow all the steps on AdMob tutorial, but when I run my application instead the banner there is "You must have AdActivity declared in AndroidManifest.xml with configChanges"
My AndroidManifest is :
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="it.gmg.android.fpg" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="8" /> <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" > <activity android:label="@string/app_name" android:name=".FPGActivity" > <intent-filter > <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name="com.google.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation"/> </application> <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> </manifest>
I think all is correct, why I cant display the banner?
Best regards
推荐答案
You are missing some entries in the configChanges attribute of the Admob AdActivity -- see Google's description here. This may also cause you to change your build target. Read my detailed answer to the related quetsion Admob implementation Error.