gallery在android2.3以下可以点击,但是在4.0系统后就出现空指针问题:

StevenYang0918 发布于 2012/12/06 10:47
阅读 1K+
收藏 0
08-10 04:34:11.888: WARN/dalvikvm(7329): threadid=1: thread exiting with uncaught exception (group=0x409961f8)
08-10 04:34:11.968: WARN/System.err(7329): java.lang.NullPointerException
08-10 04:34:12.087: WARN/System.err(7329):     at android.view.GestureDetector.onTouchEvent(GestureDetector.java:587)
08-10 04:34:12.087: WARN/System.err(7329):     at android.widget.Gallery.onTouchEvent(Gallery.java:937)
08-10 04:34:12.087: WARN/System.err(7329):     at android.view.View.dispatchTouchEvent(View.java:5486)
08-10 04:34:12.087: WARN/System.err(7329):     at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1953)
08-10 04:34:12.109: WARN/System.err(7329):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1714)
08-10 04:34:12.109: WARN/System.err(7329):     at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1959)
08-10 04:34:12.109: WARN/System.err(7329):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1728)
08-10 04:34:12.109: WARN/System.err(7329):     at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1959)
08-10 04:34:12.109: WARN/System.err(7329):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1728)
08-10 04:34:12.109: WARN/System.err(7329):     at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1959)
08-10 04:34:12.109: WARN/System.err(7329):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1728)
08-10 04:34:12.139: WARN/System.err(7329):     at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1959)
08-10 04:34:12.139: WARN/System.err(7329):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1728)
08-10 04:34:12.139: WARN/System.err(7329):     at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1959)
08-10 04:34:12.157: WARN/System.err(7329):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1728)
08-10 04:34:12.157: WARN/System.err(7329):     at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1959)
08-10 04:34:12.157: WARN/System.err(7329):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1728)
08-10 04:34:12.157: WARN/System.err(7329):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1892)
08-10 04:34:12.157: WARN/System.err(7329):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1371)
08-10 04:34:12.157: WARN/System.err(7329):     at android.app.Activity.dispatchTouchEvent(Activity.java:2364)
08-10 04:34:12.157: WARN/System.err(7329):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1840)
08-10 04:34:12.167: WARN/System.err(7329):     at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1959)
08-10 04:34:12.167: WARN/System.err(7329):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1728)
08-10 04:34:12.167: WARN/System.err(7329):     at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1959)
08-10 04:34:12.167: WARN/System.err(7329):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1728)
08-10 04:34:12.167: WARN/System.err(7329):     at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1959)
08-10 04:34:12.167: WARN/System.err(7329):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1728)
08-10 04:34:12.167: WARN/System.err(7329):     at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1959)
08-10 04:34:12.180: WARN/System.err(7329):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1728)
08-10 04:34:12.180: WARN/System.err(7329):     at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1959)
08-10 04:34:12.188: WARN/System.err(7329):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1728)
08-10 04:34:12.188: WARN/System.err(7329):     at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1959)
08-10 04:34:12.188: WARN/System.err(7329):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1728)
08-10 04:34:12.188: WARN/System.err(7329):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1892)
08-10 04:34:12.188: WARN/System.err(7329):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1371)
08-10 04:34:12.197: WARN/System.err(7329):     at android.app.Activity.dispatchTouchEvent(Activity.java:2364)
08-10 04:34:12.197: WARN/System.err(7329):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1840)
08-10 04:34:12.208: WARN/System.err(7329):     at android.view.View.dispatchPointerEvent(View.java:5662)
08-10 04:34:12.208: WARN/System.err(7329):     at android.view.ViewRootImpl.deliverPointerEvent(ViewRootImpl.java:2863)
08-10 04:34:12.208: WARN/System.err(7329):     at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2442)
08-10 04:34:12.208: WARN/System.err(7329):     at android.os.Handler.dispatchMessage(Handler.java:99)
08-10 04:34:12.208: WARN/System.err(7329):     at android.os.Looper.loop(Looper.java:137)
08-10 04:34:12.208: WARN/System.err(7329):     at android.app.ActivityThread.main(ActivityThread.java:4340)
08-10 04:34:12.208: WARN/System.err(7329):     at java.lang.reflect.Method.invokeNative(Native Method)
08-10 04:34:12.208: WARN/System.err(7329):     at java.lang.reflect.Method.invoke(Method.java:511)
08-10 04:34:12.208: WARN/System.err(7329):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
08-10 04:34:12.208: WARN/System.err(7329):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
08-10 04:34:12.208: WARN/System.err(7329):     at dalvik.system.NativeStart.main(Native Method)

以下是问题补充:

@StevenYang0918:onTouchEvent获取的事件是空,2.3上可以点击的 (2012/12/06 11:09)
加载中
0
老牟
老牟
看代码,空指针你直接抓异常啊
0
天上掉下来的程序员
天上掉下来的程序员

因为你是null哥,空指针哥,你没的救了


0
天上掉下来的程序员
天上掉下来的程序员
空指针哥,你还在nullpoint中徘徊啊
OSCHINA
登录后可查看更多优质内容
返回顶部
顶部