#1478830 java.lang.IllegalArgumentException
No view found for id 0x7f090297 (com.xx.yy:id/arg) for fragment SingArenaNoChallengerFragment{7b79bce #1 id=0x7f090297 com.xx.yy.zz.zzz.yyy.SomeFragment}
android.support.v4.app.FragmentManagerImpl.moveToState(SourceFile:1422)
android.support.v4.app.FragmentManagerImpl.moveToState(SourceFile:1422)
2 android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(SourceFile:1759)
3 android.support.v4.app.FragmentManagerImpl.moveToState(SourceFile:1827)
4 android.support.v4.app.BackStackRecord.executeOps(SourceFile:797)
5 android.support.v4.app.FragmentManagerImpl.executeOps(SourceFile:2596)
6 android.support.v4.app.FragmentManagerImpl.executeOpsTogether(SourceFile:2383)
7 android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(SourceFile:2338)
8 android.support.v4.app.FragmentManagerImpl.execPendingActions(SourceFile:2245)
9 android.support.v4.app.FragmentManagerImpl$1.run(SourceFile:703)
10 android.os.Handler.handleCallback(Handler.java:907)
11 android.os.Handler.dispatchMessage(Handler.java:105)
12 android.os.Looper.loop(Looper.java:216)
13 android.app.ActivityThread.main(ActivityThread.java:7625)
14 java.lang.reflect.Method.invoke(Native Method)
15 com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)
16 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)
原因,fragment嵌套Fragment导致,而且是动态add的fragment
etFragmentManager().beginTransaction().hide(this).commitAllowingStateLoss();
getFragmentManager().beginTransaction().show(this).commitAllowingStateLoss();
解决方案:
将 getFragmentManager 或者 getSupportFragmentManager
换成
getChildFragmentManager
或者是直接把fragment写到xml文件中