I override dispatchTouchEvent() like this: public boolean dispatchTouchEvent(MotionEvent ev) { WebView v=findViewById(R.id.detail); return v.dispatchTouchEvent(ev); }
I am getting intermittent NullPointerException like this: 07-03 18:03:54.530: ERROR/AndroidRuntime(1681): java.lang.NullPointerException 07-03 18:03:54.530: ERROR/AndroidRuntime(1681): at android.webkit.WebView.onTouchEvent(WebView.java:3566) 07-03 18:03:54.530: ERROR/AndroidRuntime(1681): at android.view.View.dispatchTouchEvent(View.java:3368) 07-03 18:03:54.530: ERROR/AndroidRuntime(1681): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:831) 07-03 18:03:54.530: ERROR/AndroidRuntime(1681): at com.wth.xxxView.dispatchTouchEvent(xxxView.java:118) 07-03 18:03:54.530: ERROR/AndroidRuntime(1681): at com.android.internal.policy.impl.PhoneWindow $DecorView.dispatchTouchEvent(PhoneWindow.java:1691) 07-03 18:03:54.530: ERROR/AndroidRuntime(1681): at android.view.ViewRoot.handleMessage(ViewRoot.java:1525) 07-03 18:03:54.530: ERROR/AndroidRuntime(1681): at android.os.Handler.dispatchMessage(Handler.java:99) 07-03 18:03:54.530: ERROR/AndroidRuntime(1681): at android.os.Looper.loop(Looper.java:123) 07-03 18:03:54.530: ERROR/AndroidRuntime(1681): at android.app.ActivityThread.main(ActivityThread.java:3948) 07-03 18:03:54.530: ERROR/AndroidRuntime(1681): at java.lang.reflect.Method.invokeNative(Native Method) 07-03 18:03:54.530: ERROR/AndroidRuntime(1681): at java.lang.reflect.Method.invoke(Method.java:521) 07-03 18:03:54.530: ERROR/AndroidRuntime(1681): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:782) 07-03 18:03:54.530: ERROR/AndroidRuntime(1681): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540) 07-03 18:03:54.530: ERROR/AndroidRuntime(1681): at dalvik.system.NativeStart.main(Native Method) I verify that the variable v is never null. How come there can be nullpointer exception happening in android.webkit.WebView.onTouchEvent???? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---