创建片段时的java.lang.StackOverflowError

时间:2015-06-21 10:25:29

标签: java android xml android-studio

我遇到了java.lang.StackOverflowError的渲染问题。我将堆栈与主xml代码一起复制到剪贴板。剪贴板的部分内容是:

java.lang.StackOverflowError
    at android.view.RenderNode.<init>(RenderNode.java:174)
    at android.view.RenderNode.create(RenderNode.java:196)
    at android.view.View.<init>(View.java:3591)
    at android.view.View.<init>(View.java:3682)
    at android.view.ViewGroup.<init>(ViewGroup.java:497)
    at android.widget.RelativeLayout.<init>(RelativeLayout.java:248)
    at android.widget.RelativeLayout.<init>(RelativeLayout.java:244)
    at android.widget.RelativeLayout.<init>(RelativeLayout.java:240)
    at sun.reflect.GeneratedConstructorAccessor303.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
    at android.view.LayoutInflater.createView(LayoutInflater.java:607)
    at android.view.BridgeInflater.onCreateView(BridgeInflater.java:93)
    at android.view.LayoutInflater.onCreateView(LayoutInflater.java:682)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:741)
    at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:138)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:117)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)
    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:858)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:802)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
    at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:154)

main_activity.xml代码: -

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity"
android:id="@+id/layout1">

<fragment
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:name="com.example.paramjeet.memegenerator.TopSection"
    android:id="@+id/fragment"
    android:layout_alignParentTop="true"
    android:layout_centerHorizontal="true"
    tools:layout="@layout/fragment" />

TopSection.java

package com.example.paramjeet.memegenerator;

import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

public class TopSection extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment,container,false);
return view;
    }
}

fragment.xml之

    <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent" android:layout_height="match_parent"
    >

    <EditText
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/toptext"
        android:layout_marginTop="25dp"
        android:width="250dp"
        android:layout_centerHorizontal="true"
        android:inputType="text" />

    <EditText
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/bottomtext"
        android:layout_marginTop="25dp"
        android:width="250dp"
        android:layout_centerHorizontal="true"
        android:layout_below="@id/toptext"
        android:inputType="text" />

    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/button_res"
        android:id="@+id/button1"
        android:layout_below="@+id/bottomtext"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="25dp" />

</RelativeLayout>

请帮助。

1 个答案:

答案 0 :(得分:4)

您可以在堆栈跟踪中看到,递归调用LayoutInflater。因此,似乎片段的布局中存在错误,其中它递归地包含其自己的布局。

如果您发布片段的布局,我还可以告诉您更多信息。