我正在尝试在viewpager
的某些网页中添加AdView。我正在使用ActionbarSherlock
,每个页面都是一个片段。我正在使用我的适配器动态添加adview。它显示广告正常但是一旦我点击它我得到nullpointerexception
。
有没有人遇到过类似的问题?
02-28 08:13:55.533: E/AndroidRuntime(31181): FATAL EXCEPTION: main
02-28 08:13:55.533: E/AndroidRuntime(31181): java.lang.NullPointerException
02-28 08:13:55.533: E/AndroidRuntime(31181): at com.google.ads.util.h.a(SourceFile:52)
02-28 08:13:55.533: E/AndroidRuntime(31181): at com.google.ads.internal.AdWebView.canScrollHorizontally(SourceFile:398)
02-28 08:13:55.533: E/AndroidRuntime(31181): at android.support.v4.view.ViewCompatICS.canScrollHorizontally(ViewCompatICS.java:30)
02-28 08:13:55.533: E/AndroidRuntime(31181): at android.support.v4.view.ViewCompat$ICSViewCompatImpl.canScrollHorizontally(ViewCompat.java:237)
02-28 08:13:55.533: E/AndroidRuntime(31181): at android.support.v4.view.ViewCompat.canScrollHorizontally(ViewCompat.java:347)
02-28 08:13:55.533: E/AndroidRuntime(31181): at android.support.v4.view.ViewPager.canScroll(ViewPager.java:2377)
02-28 08:13:55.533: E/AndroidRuntime(31181): at android.support.v4.view.ViewPager.canScroll(ViewPager.java:2368)
02-28 08:13:55.533: E/AndroidRuntime(31181): at android.support.v4.view.ViewPager.canScroll(ViewPager.java:2368)
02-28 08:13:55.533: E/AndroidRuntime(31181): at android.support.v4.view.ViewPager.canScroll(ViewPager.java:2368)
02-28 08:13:55.533: E/AndroidRuntime(31181): at android.support.v4.view.ViewPager.canScroll(ViewPager.java:2368)
02-28 08:13:55.533: E/AndroidRuntime(31181): at android.support.v4.view.ViewPager.canScroll(ViewPager.java:2368)
02-28 08:13:55.533: E/AndroidRuntime(31181): at android.support.v4.view.ViewPager.canScroll(ViewPager.java:2368)
02-28 08:13:55.533: E/AndroidRuntime(31181): at android.support.v4.view.ViewPager.canScroll(ViewPager.java:2368)
02-28 08:13:55.533: E/AndroidRuntime(31181): at android.support.v4.view.ViewPager.onInterceptTouchEvent(ViewPager.java:1775)
02-28 08:13:55.533: E/AndroidRuntime(31181): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1817)
02-28 08:13:55.533: E/AndroidRuntime(31181): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2174)
02-28 08:13:55.533: E/AndroidRuntime(31181): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1917)
02-28 08:13:55.533: E/AndroidRuntime(31181): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2174)
02-28 08:13:55.533: E/AndroidRuntime(31181): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1917)
02-28 08:13:55.533: E/AndroidRuntime(31181): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2174)
02-28 08:13:55.533: E/AndroidRuntime(31181): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1917)
02-28 08:13:55.533: E/AndroidRuntime(31181): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2174)
02-28 08:13:55.533: E/AndroidRuntime(31181): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1917)
02-28 08:13:55.533: E/AndroidRuntime(31181): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1953)
02-28 08:13:55.533: E/AndroidRuntime(31181): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1405)
02-28 08:13:55.533: E/AndroidRuntime(31181): at android.app.Activity.dispatchTouchEvent(Activity.java:2410)
02-28 08:13:55.533: E/AndroidRuntime(31181): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1901)
02-28 08:13:55.533: E/AndroidRuntime(31181): at android.view.View.dispatchPointerEvent(View.java:7426)
02-28 08:13:55.533: E/AndroidRuntime(31181): at android.view.ViewRootImpl.deliverPointerEvent(ViewRootImpl.java:3220)
02-28 08:13:55.533: E/AndroidRuntime(31181): at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:3165)
02-28 08:13:55.533: E/AndroidRuntime(31181): at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:4292)
02-28 08:13:55.533: E/AndroidRuntime(31181): at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:4271)
02-28 08:13:55.533: E/AndroidRuntime(31181): at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:4363)
02-28 08:13:55.533: E/AndroidRuntime(31181): at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:179)
02-28 08:13:55.533: E/AndroidRuntime(31181): at android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(Native Method)
02-28 08:13:55.533: E/AndroidRuntime(31181): at android.view.InputEventReceiver.consumeBatchedInputEvents(InputEventReceiver.java:171)
02-28 08:13:55.533: E/AndroidRuntime(31181): at android.view.ViewRootImpl.doConsumeBatchedInput(ViewRootImpl.java:4342)
02-28 08:13:55.533: E/AndroidRuntime(31181): at android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run(ViewRootImpl.java:4382)
02-28 08:13:55.533: E/AndroidRuntime(31181): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749)
02-28 08:13:55.533: E/AndroidRuntime(31181): at android.view.Choreographer.doCallbacks(Choreographer.java:562)
02-28 08:13:55.533: E/AndroidRuntime(31181): at android.view.Choreographer.doFrame(Choreographer.java:530)
02-28 08:13:55.533: E/AndroidRuntime(31181): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735)
02-28 08:13:55.533: E/AndroidRuntime(31181): at android.os.Handler.handleCallback(Handler.java:725)
02-28 08:13:55.533: E/AndroidRuntime(31181): at android.os.Handler.dispatchMessage(Handler.java:92)
02-28 08:13:55.533: E/AndroidRuntime(31181): at android.os.Looper.loop(Looper.java:137)
02-28 08:13:55.533: E/AndroidRuntime(31181): at android.app.ActivityThread.main(ActivityThread.java:5041)
02-28 08:13:55.533: E/AndroidRuntime(31181): at java.lang.reflect.Method.invokeNative(Native Method)
02-28 08:13:55.533: E/AndroidRuntime(31181): at java.lang.reflect.Method.invoke(Method.java:511)
02-28 08:13:55.533: E/AndroidRuntime(31181): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
02-28 08:13:55.533: E/AndroidRuntime(31181): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
02-28 08:13:55.533: E/AndroidRuntime(31181): at dalvik.system.NativeStart.main(Native Method)