回到纵向模式时片段怪异崩溃

时间:2014-01-08 23:38:36

标签: android android-fragments crash back-stack android-appcompat

我的应用程序有一个MainActivity和四个片段,其中第二个片段包含master&景观模式的细节布局。

App Flow(横向模式) - MainActivity->片段1 - >片段2 |片段3 - >片段4

当我回到第二个片段到肖像模式时,应用程序崩溃了。

仅供参考:使用actionbar-compat lib。

崩溃日志:

01-09 03:42:01.479: E/InputEventSender(18767): Exception dispatching finished signal.
01-09 03:42:01.479: E/MessageQueue-JNI(18767): Exception in MessageQueue callback: handleReceiveCallback
01-09 03:42:01.509: E/MessageQueue-JNI(18767): java.lang.IllegalArgumentException: No view found for id 0x7f090070 (abc.fragmentdemo:id/detail_layout) for fragment Fragment3{41e0def0 #0 id=0x7f090070 detailsFrag}
01-09 03:42:01.509: E/MessageQueue-JNI(18767):  at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:919)
01-09 03:42:01.509: E/MessageQueue-JNI(18767):  at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1104)
01-09 03:42:01.509: E/MessageQueue-JNI(18767):  at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1086)
01-09 03:42:01.509: E/MessageQueue-JNI(18767):  at android.support.v4.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:1884)
01-09 03:42:01.509: E/MessageQueue-JNI(18767):  at android.support.v4.app.Fragment.performActivityCreated(Fragment.java:1514)
01-09 03:42:01.509: E/MessageQueue-JNI(18767):  at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:947)
01-09 03:42:01.509: E/MessageQueue-JNI(18767):  at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1104)
01-09 03:42:01.509: E/MessageQueue-JNI(18767):  at android.support.v4.app.BackStackRecord.popFromBackStack(BackStackRecord.java:764)
01-09 03:42:01.509: E/MessageQueue-JNI(18767):  at android.support.v4.app.FragmentManagerImpl.popBackStackState(FragmentManager.java:1516)
01-09 03:42:01.509: E/MessageQueue-JNI(18767):  at android.support.v4.app.FragmentManagerImpl.popBackStackImmediate(FragmentManager.java:488)
01-09 03:42:01.509: E/MessageQueue-JNI(18767):  at android.support.v4.app.FragmentActivity.onBackPressed(FragmentActivity.java:179)
01-09 03:42:01.509: E/MessageQueue-JNI(18767):  at android.support.v7.app.ActionBarActivity.onBackPressed(ActionBarActivity.java:250)

DemoApp代码

Download Zip

git:https://github.com/bipinvaylu/FragmentDemo.git

0 个答案:

没有答案