只有当应用程序运行某些设备时,我才会收到StackOverflowError错误,它可以与其他设备一起使用.
这是堆栈跟踪:
java.lang.StackOverflowError
at android.support.v7.widget.GridLayout$Axis$1.walk(GridLayout.java:1315)
...
...
at android.support.v7.widget.GridLayout$Axis$1.walk(GridLayout.java:1315)
at android.support.v7.widget.GridLayout$Axis$1.sort(GridLayout.java:1333)
at android.support.v7.widget.GridLayout$Axis.topologicalSort(GridLayout.java:1304)
at android.support.v7.widget.GridLayout$Axis.topologicalSort(GridLayout.java:1342)
at android.support.v7.widget.GridLayout$Axis.createArcs(GridLayout.java:1376)
at android.support.v7.widget.GridLayout$Axis.getArcs(GridLayout.java:1390)
at android.support.v7.widget.GridLayout$Axis.computeLocations(GridLayout.java:1575)
at android.support.v7.widget.GridLayout$Axis.getLocations(GridLayout.java:1596)
at android.support.v7.widget.GridLayout$Axis.getMeasure(GridLayout.java:1617)
at android.support.v7.widget.GridLayout$Axis.getMeasure(GridLayout.java:1625)
at android.support.v7.widget.GridLayout.onMeasure(GridLayout.java:939)
at android.view.View.measure(View.java:12911)
at android.widget.HorizontalScrollView.measureChildWithMargins(HorizontalScrollView.java:1159)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:297)
at android.widget.HorizontalScrollView.onMeasure(HorizontalScrollView.java:303)
at android.view.View.measure(View.java:12911)
at android.widget.ScrollView.measureChildWithMargins(ScrollView.java:1163)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:297)
at android.widget.ScrollView.onMeasure(ScrollView.java:312)
at android.view.View.measure(View.java:12911)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4805)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1399)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:676)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:557)
at android.view.View.measure(View.java:12911)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4805)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:297)
at android.view.View.measure(View.java:12911)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:828)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:557)
at android.view.View.measure(View.java:12911)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4805)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:297)
at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2097)
at android.view.View.measure(View.java:12911)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1064)
at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2442)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4448)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:823)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:590)
at dalvik.system.NativeStart.main(Native Method)
请提示一下吗?
最佳答案 只是调试了类似的情况,结果发现用于设置支持的二维数组 – GridLayout对于我测试的所有2.3.x设备来说太大了.删除了最大行数并避免了StackOverflowError.希望这些信息有助于您的案例!