我有一個奇怪的錯誤(NullPointerException)有時使用畫廊部件有時會發生,只有有時在不同的方向快速滾動 - 奇怪的是,沒有我的類在堆棧跟蹤。NullPointerException當滾動畫廊部件
沒有人有任何想法可能會導致問題?
10-05 11:54:45.080: ERROR/AndroidRuntime(24935): FATAL EXCEPTION: main
10-05 11:54:45.080: ERROR/AndroidRuntime(24935): java.lang.NullPointerException
10-05 11:54:45.080: ERROR/AndroidRuntime(24935): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
10-05 11:54:45.080: ERROR/AndroidRuntime(24935): at android.view.View.draw(View.java:6906)
10-05 11:54:45.080: ERROR/AndroidRuntime(24935): at android.view.ViewGroup.drawChild(ViewGroup.java:1640)
10-05 11:54:45.080: ERROR/AndroidRuntime(24935): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
10-05 11:54:45.080: ERROR/AndroidRuntime(24935): at android.view.ViewGroup.drawChild(ViewGroup.java:1638)
10-05 11:54:45.080: ERROR/AndroidRuntime(24935): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
10-05 11:54:45.080: ERROR/AndroidRuntime(24935): at android.view.View.draw(View.java:6906)
10-05 11:54:45.080: ERROR/AndroidRuntime(24935): at android.widget.FrameLayout.draw(FrameLayout.java:352)
10-05 11:54:45.080: ERROR/AndroidRuntime(24935): at android.view.ViewGroup.drawChild(ViewGroup.java:1640)
10-05 11:54:45.080: ERROR/AndroidRuntime(24935): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
10-05 11:54:45.080: ERROR/AndroidRuntime(24935): at android.view.View.draw(View.java:6906)
10-05 11:54:45.080: ERROR/AndroidRuntime(24935): at android.widget.FrameLayout.draw(FrameLayout.java:352)
10-05 11:54:45.080: ERROR/AndroidRuntime(24935): at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1868)
10-05 11:54:45.080: ERROR/AndroidRuntime(24935): at android.view.ViewRoot.draw(ViewRoot.java:1407)
10-05 11:54:45.080: ERROR/AndroidRuntime(24935): at android.view.ViewRoot.performTraversals(ViewRoot.java:1163)
10-05 11:54:45.080: ERROR/AndroidRuntime(24935): at android.view.ViewRoot.handleMessage(ViewRoot.java:1727)
10-05 11:54:45.080: ERROR/AndroidRuntime(24935): at android.os.Handler.dispatchMessage(Handler.java:99)
10-05 11:54:45.080: ERROR/AndroidRuntime(24935): at android.os.Looper.loop(Looper.java:123)
10-05 11:54:45.080: ERROR/AndroidRuntime(24935): at android.app.ActivityThread.main(ActivityThread.java:4627)
10-05 11:54:45.080: ERROR/AndroidRuntime(24935): at java.lang.reflect.Method.invokeNative(Native Method)
10-05 11:54:45.080: ERROR/AndroidRuntime(24935): at java.lang.reflect.Method.invoke(Method.java:521)
10-05 11:54:45.080: ERROR/AndroidRuntime(24935): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:876)
10-05 11:54:45.080: ERROR/AndroidRuntime(24935): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:634)
10-05 11:54:45.080: ERROR/AndroidRuntime(24935): at dalvik.system.NativeStart.main(Native Method)
你應該顯示你的代碼,你試過做什麼。 –
這是一個相當大的項目 - 我正在使用的畫廊實際上是擴展了畫廊小部件,我在一個單獨的線程中使用延遲加載的圖像以及大量可能導致問題的代碼......但我怎麼知道是什麼原因造成的如果我的類沒有列出在堆棧跟蹤中?我甚至不知道代碼的哪些部分可以在這裏發佈...... – imbryk
好的沒問題,Bitmap API的問題在那裏,它通過null的位圖的大小超過了一些限制,可能是問題你的情況。 –