我刚刚将StaggeredView演示导入我的工作区,我在 eclipse 中没有收到任何错误,但是当我尝试启动演示时,我在 logCat 中收到以下错误:
09-17 14:01:06.111: E/AndroidRuntime(11611): FATAL EXCEPTION: main
09-17 14:01:06.111: E/AndroidRuntime(11611): java.lang.NullPointerException
09-17 14:01:06.111: E/AndroidRuntime(11611): at android.view.ViewGroup$LayoutParams.<init>(ViewGroup.java:5299)
09-17 14:01:06.111: E/AndroidRuntime(11611): at android.support.v4.widget.StaggeredGridView$LayoutParams.<init>(StaggeredGridView.java:1768)
09-17 14:01:06.111: E/AndroidRuntime(11611): at android.support.v4.widget.StaggeredGridView.generateLayoutParams(StaggeredGridView.java:1657)
09-17 14:01:06.111: E/AndroidRuntime(11611): at android.support.v4.widget.StaggeredGridView.generateLayoutParams(StaggeredGridView.java:1)
09-17 14:01:06.111: E/AndroidRuntime(11611): at android.view.ViewGroup.addViewInner(ViewGroup.java:3346)
09-17 14:01:06.111: E/AndroidRuntime(11611): at android.view.ViewGroup.addViewInLayout(ViewGroup.java:3313)
09-17 14:01:06.111: E/AndroidRuntime(11611): at android.view.ViewGroup.addViewInLayout(ViewGroup.java:3294)
09-17 14:01:06.111: E/AndroidRuntime(11611): at android.support.v4.widget.StaggeredGridView.fillDown(StaggeredGridView.java:1250)
09-17 14:01:06.111: E/AndroidRuntime(11611): at android.support.v4.widget.StaggeredGridView.populate(StaggeredGridView.java:844)
09-17 14:01:06.111: E/AndroidRuntime(11611): at android.support.v4.widget.StaggeredGridView.onLayout(StaggeredGridView.java:795)
09-17 14:01:06.111: E/AndroidRuntime(11611): at android.view.View.layout(View.java:11280)
09-17 14:01:06.111: E/AndroidRuntime(11611): at android.view.ViewGroup.layout(ViewGroup.java:4224)
09-17 14:01:06.111: E/AndroidRuntime(11611): at android.widget.RelativeLayout.onLayout(RelativeLayout.java:925)
09-17 14:01:06.111: E/AndroidRuntime(11611): at android.view.View.layout(View.java:11280)
09-17 14:01:06.111: E/AndroidRuntime(11611): at android.view.ViewGroup.layout(ViewGroup.java:4224)
09-17 14:01:06.111: E/AndroidRuntime(11611): at android.widget.FrameLayout.onLayout(FrameLayout.java:431)
09-17 14:01:06.111: E/AndroidRuntime(11611): at android.view.View.layout(View.java:11280)
09-17 14:01:06.111: E/AndroidRuntime(11611): at android.view.ViewGroup.layout(ViewGroup.java:4224)
09-17 14:01:06.111: E/AndroidRuntime(11611): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1628)
09-17 14:01:06.111: E/AndroidRuntime(11611): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1486)
09-17 14:01:06.111: E/AndroidRuntime(11611): at android.widget.LinearLayout.onLayout(LinearLayout.java:1399)
09-17 14:01:06.111: E/AndroidRuntime(11611): at android.view.View.layout(View.java:11280)
09-17 14:01:06.111: E/AndroidRuntime(11611): at android.view.ViewGroup.layout(ViewGroup.java:4224)
09-17 14:01:06.111: E/AndroidRuntime(11611): at android.widget.FrameLayout.onLayout(FrameLayout.java:431)
09-17 14:01:06.111: E/AndroidRuntime(11611): at android.view.View.layout(View.java:11280)
09-17 14:01:06.111: E/AndroidRuntime(11611): at android.view.ViewGroup.layout(ViewGroup.java:4224)
09-17 14:01:06.111: E/AndroidRuntime(11611): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1500)
09-17 14:01:06.111: E/AndroidRuntime(11611): at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2453)
09-17 14:01:06.111: E/AndroidRuntime(11611): at android.os.Handler.dispatchMessage(Handler.java:99)
09-17 14:01:06.111: E/AndroidRuntime(11611): at android.os.Looper.loop(Looper.java:137)
09-17 14:01:06.111: E/AndroidRuntime(11611): at android.app.ActivityThread.main(ActivityThread.java:4424)
09-17 14:01:06.111: E/AndroidRuntime(11611): at java.lang.reflect.Method.invokeNative(Native Method)
09-17 14:01:06.111: E/AndroidRuntime(11611): at java.lang.reflect.Method.invoke(Method.java:511)
09-17 14:01:06.111: E/AndroidRuntime(11611): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
09-17 14:01:06.111: E/AndroidRuntime(11611): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
09-17 14:01:06.111: E/AndroidRuntime(11611): at dalvik.system.NativeStart.main(Native Method)
有人能告诉我为什么我会收到这个错误吗?