Android 膨胀包含2个子片段的片段时出错
java:(stackoverflow警告我,为什么?) My fragment_sound.xml,其中包含2个子片段Android 膨胀包含2个子片段的片段时出错,android,fragment,Android,Fragment,java:(stackoverflow警告我,为什么?) My fragment_sound.xml,其中包含2个子片段 > <LinearLayout > xmlns:android="http://schemas.android.com/apk/res/android" > xmlns:tools="http://schemas.android.com/tools" > android:layout_width="match_parent" &g
> <LinearLayout
> 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:orientation="vertical"
> tools:context="jp.porthy.getclub.fragment.SoundFragment">
>
> <TabHost
> android:id="@+id/soundtabhost"
> android:layout_width="match_parent"
> android:layout_height="match_parent">
>
> <LinearLayout
> android:layout_width="match_parent"
> android:layout_height="match_parent"
> android:orientation="vertical">
>
> <TabWidget
> android:id="@android:id/tabs"
> android:layout_width="match_parent"
> android:showDividers="none"
> android:layout_height="38dp" />
>
> <FrameLayout
> android:id="@android:id/tabcontent"
> android:layout_width="match_parent"
> android:layout_height="match_parent">
>
> <LinearLayout
> android:id="@+id/tabBGM"
> android:layout_width="match_parent"
> android:layout_height="match_parent"
> android:orientation="vertical">
>
> <FrameLayout
> android:id="@+id/gc_sound_bgm_fragment"
> android:layout_width="fill_parent"
> android:layout_height="fill_parent">
>
> </FrameLayout>
> </LinearLayout>
>
> <LinearLayout
> android:id="@+id/tabSoundEffect"
> android:layout_width="match_parent"
> android:layout_height="match_parent"
> android:orientation="vertical">
>
> <FrameLayout
> android:layout_width="fill_parent"
> android:layout_height="fill_parent"
> android:id="@+id/gc_sound_effect_fragment">
>
> </FrameLayout>
> </LinearLayout>
> </FrameLayout>
> </LinearLayout>
> </TabHost>
>
> </LinearLayout>
我尝试在加载视图和销毁视图后添加延迟时间,但它可以解决我的问题。
重复附加和分离SoundFragment时出错
请帮我调试,非常感谢。请检查您的R.java文件中是否有0x7f0c00d9的条目。很可能此条目不存在。问题似乎出现在
SoundFragmentBGM
fragment中。显示代码和xml布局我认为SoundFragmentBGM片段中没有问题。重复附加和分离SoundFragment时出错。我想当旧的SoundFragmentBGM没有分离,我尝试连接新的时,它崩溃了。如果我错了,请纠正我,非常感谢。在R.java中:公共静态final int gc_sound_bgm_fragment=0x7f0c00d9;请在R.java文件中检查是否有0x7f0c00d9的条目。很可能此条目不存在。问题似乎出现在SoundFragmentBGM
fragment中。显示代码和xml布局我认为SoundFragmentBGM片段中没有问题。重复附加和分离SoundFragment时出错。我想当旧的SoundFragmentBGM没有分离,我尝试连接新的时,它崩溃了。如果我错了,请纠正我,非常感谢。在R.java中:公共静态final int gc_sound_bgm_fragment=0x7f0c00d9;
> <LinearLayout
> 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:orientation="vertical"
> tools:context="jp.porthy.getclub.fragment.SoundFragment">
>
> <TabHost
> android:id="@+id/soundtabhost"
> android:layout_width="match_parent"
> android:layout_height="match_parent">
>
> <LinearLayout
> android:layout_width="match_parent"
> android:layout_height="match_parent"
> android:orientation="vertical">
>
> <TabWidget
> android:id="@android:id/tabs"
> android:layout_width="match_parent"
> android:showDividers="none"
> android:layout_height="38dp" />
>
> <FrameLayout
> android:id="@android:id/tabcontent"
> android:layout_width="match_parent"
> android:layout_height="match_parent">
>
> <LinearLayout
> android:id="@+id/tabBGM"
> android:layout_width="match_parent"
> android:layout_height="match_parent"
> android:orientation="vertical">
>
> <FrameLayout
> android:id="@+id/gc_sound_bgm_fragment"
> android:layout_width="fill_parent"
> android:layout_height="fill_parent">
>
> </FrameLayout>
> </LinearLayout>
>
> <LinearLayout
> android:id="@+id/tabSoundEffect"
> android:layout_width="match_parent"
> android:layout_height="match_parent"
> android:orientation="vertical">
>
> <FrameLayout
> android:layout_width="fill_parent"
> android:layout_height="fill_parent"
> android:id="@+id/gc_sound_effect_fragment">
>
> </FrameLayout>
> </LinearLayout>
> </FrameLayout>
> </LinearLayout>
> </TabHost>
>
> </LinearLayout>
07-14 16:20:47.893 28471-28471/jp.porthy.getclub W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x40aaf210)
07-14 16:20:47.903 28471-28471/jp.porthy.getclub E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.IllegalArgumentException: No view found for id 0x7f0c00d9 for fragment SoundFragmentBGM{420d43b8 #1 id=0x7f0c00d9}
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:822)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1032)
at android.app.BackStackRecord.run(BackStackRecord.java:622)
at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1382)
at android.app.FragmentManagerImpl$1.run(FragmentManager.java:426)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4441)
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)