2

我正在使用 Slidemenu 库,但出现错误请告诉我如何解决此错误

enter code here

09-07 11:18:20.906: E/AndroidRuntime(26322): FATAL EXCEPTION: main
09-07 11:18:20.906: E/AndroidRuntime(26322): java.lang.StackOverflowError
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.text.Layout.drawText(Layout.java:1387)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.text.Layout.draw(Layout.java:370)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.widget.TextView.onDraw(TextView.java:4194)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.View.draw(View.java:6740)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.ViewGroup.drawChild(ViewGroup.java:1640)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.View.draw(View.java:6743)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.ViewGroup.drawChild(ViewGroup.java:1640)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.View.draw(View.java:6743)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.ViewGroup.drawChild(ViewGroup.java:1640)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.View.draw(View.java:6743)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.ViewGroup.drawChild(ViewGroup.java:1640)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.ViewGroup.drawChild(ViewGroup.java:1638)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.ViewGroup.drawChild(ViewGroup.java:1638)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.View.draw(View.java:6743)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.ViewGroup.drawChild(ViewGroup.java:1640)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.View.draw(View.java:6743)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.widget.FrameLayout.draw(FrameLayout.java:352)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.ViewGroup.drawChild(ViewGroup.java:1640)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at com.slidingmenu.lib.CustomViewAbove.dispatchDraw(CustomViewAbove.java:832)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.View.draw(View.java:6743)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.ViewGroup.drawChild(ViewGroup.java:1640)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.View.draw(View.java:6743)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.ViewGroup.drawChild(ViewGroup.java:1640)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.ViewGroup.drawChild(ViewGroup.java:1638)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.View.draw(View.java:6743)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.widget.FrameLayout.draw(FrameLayout.java:352)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.ViewGroup.drawChild(ViewGroup.java:1640)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.ViewGroup.drawChild(ViewGroup.java:1638)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.View.draw(View.java:6743)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.widget.FrameLayout.draw(FrameLayout.java:352)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.ViewGroup.drawChild(ViewGroup.java:1640)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.ViewGroup.drawChild(ViewGroup.java:1638)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.View.draw(View.java:6743)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.widget.FrameLayout.draw(FrameLayout.java:352)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.ViewGroup.drawChild(ViewGroup.java:1640)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.ViewGroup.drawChild(ViewGroup.java:1638)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.View.draw(View.java:6743)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.widget.FrameLayout.draw(FrameLayout.java:352)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.ViewGroup.drawChild(ViewGroup.java:1640)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.ViewGroup.drawChild(ViewGroup.java:1638)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.ViewGroup.drawChild(ViewGroup.java:1638)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.View.draw(View.java:6743)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.widget.FrameLayout.draw(FrameLayout.java:352)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:2049)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.ViewRoot.draw(ViewRoot.java:1429)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.ViewRoot.performTraversals(ViewRoot.java:1172)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.view.ViewRoot.handleMessage(ViewRoot.java:1749)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.os.Handler.dispatchMessage(Handler.java:99)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.os.Looper.loop(Looper.java:123)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at android.app.ActivityThread.main(ActivityThread.java:4627)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at java.lang.reflect.Method.invokeNative(Native Method)
09-07 11:18:20.906: E/AndroidRuntime(26322):    at java.
4

2 回答 2

3

我从未使用过这个库,但您的菜单似乎使您的视图层次结构太深(嵌套层太多)。使用 Hierarchy Viewer 检查树的深度,不应超过 10-12 层。

于 2013-09-07T06:15:27.877 回答
1

查看生成片段的代码,您可能会创建多次相同的片段。您可以尝试两种选择:

  1. 如果它们已经存在,请不要重新创建您的片段!= null。您可以添加一个简单的代码来检查这一点并忽略创建步骤。

  2. 也许你需要你的片段是活着的,然后不能重新创建,你可以使用这个方法getSupportFragmentManager().findFragmentByTag来获取一个已经创建的片段。

于 2014-10-28T14:38:56.007 回答