我已经使用了admob sdk并添加了外部jar.In xml我指定了
<linearLayout xmlns:androID="http://schemas.androID.com/apk/res/androID" xmlns:ads="http://schemas.androID.com/apk/lib/com.Google.ads" androID:layout_wIDth="fill_parent" androID:layout_height="fill_parent"><TextVIEw androID:ID="@+ID/headerfIEld" androID:layout_wIDth="fill_parent" androID:layout_height="wrap_content"><ListVIEw androID:ID="@+ID/List" androID:layout_wIDth="fill_parent" androID:layout_wIDth="fill_parent" androID:layout_height="wrap_content"><com.Google.ads.AdVIEw androID:ID="@+ID/ad" androID:layout_wIDth="fill_parent" androID:layout_height="wrap_content" ads:adSize="BANNER" ads:adUnitID="Publisher ID" ads:loadAdOnCreate="true" /> </linearLayout>
表现
<activity androID:name="com.Google.ads.AdActivity" androID:configChanges="keyboard|keyboardHIDden|orIEntation"/>
但在图形模式下它给我一个错误日志:
com.Google.ads.AdVIEw - the following class Could not be instantiated.
程序里面显示它
您必须在AndroIDManifest.xml中使用configChanges声明AdActivity.
解决方法:
从documentation开始,您需要在活动中包含其他configChanges(假设您使用的是4.3.1或更高版本):
<activity androID:name="com.Google.ads.AdActivity" androID:configChanges="keyboard|keyboardHIDden|orIEntation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
如果遇到无法识别screenSize和smallestScreenSize的问题,则必须编译aganist AndroID 3.2或更高版本.有关将4.1.1推向更新版本的更多信息,请查看此migration blog post(同样适用于移至6.0.0).
总结以上是内存溢出为你收集整理的android – com.google.ads.AdView无法实例化全部内容,希望文章能够帮你解决android – com.google.ads.AdView无法实例化所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)