我AdModAdsView
在我的应用程序中添加了一个。它似乎工作....但是,在 Logcat 我有以下错误:
08-02 18:55:41.170: E/Ads(17498): An error occurred while destroying an AdWebView:
08-02 18:55:41.170: E/Ads(17498): java.lang.NullPointerException
08-02 18:55:41.170: E/Ads(17498): at android.webkit.WebView.setWebViewClient(WebView.java:4361)
08-02 18:55:41.170: E/Ads(17498): at com.google.ads.internal.AdWebView.destroy(SourceFile:252)
08-02 18:55:41.170: E/Ads(17498): at com.google.ads.internal.c$e.run(SourceFile:191)
08-02 18:55:41.170: E/Ads(17498): at android.os.Handler.handleCallback(Handler.java:605)
08-02 18:55:41.170: E/Ads(17498): at android.os.Handler.dispatchMessage(Handler.java:92)
08-02 18:55:41.170: E/Ads(17498): at android.os.Looper.loop(Looper.java:137)
08-02 18:55:41.170: E/Ads(17498): at android.app.ActivityThread.main(ActivityThread.java:4507)
08-02 18:55:41.170: E/Ads(17498): at java.lang.reflect.Method.invokeNative(Native Method)
08-02 18:55:41.170: E/Ads(17498): at java.lang.reflect.Method.invoke(Method.java:511)
08-02 18:55:41.170: E/Ads(17498): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)
08-02 18:55:41.170: E/Ads(17498): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
08-02 18:55:41.170: E/Ads(17498): at dalvik.system.NativeStart.main(Native Method)
我遵循了这个指导方针。
<com.google.ads.AdView
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:id="@+id/banner2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
ads:adSize="BANNER"
ads:adUnitId="a150183ee58a0ed"
ads:loadAdOnCreate="true"
android:orientation="vertical" >
</com.google.ads.AdView>