问题:
Caused by: java.lang.IllegalStateException: No host
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1194)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1189)
at android.support.v4.app.FragmentManagerImpl.dispatchPause(FragmentManager.java:2015)
at android.support.v4.app.Fragment.performPause(Fragment.java:2120)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1077)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1207)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1189)
at android.support.v4.app.FragmentManagerImpl.dispatchPause(FragmentManager.java:2015)
at android.support.v4.app.FragmentController.dispatchPause(FragmentController.java:198)
at android.support.v4.app.FragmentActivity.onPause(FragmentActivity.java:365)
at cn.nubia.accounts.AccountIntroActivity.onPause(AccountIntroActivity.java:566)
at android.app.Activity.performPause(Activity.java:6101)
at android.app.Instrumentation.callActivityOnPause(Instrumentation.java:1462)
at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3424)
at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3397)
at android.app.ActivityThread.handlePauseActivity(ActivityThread.java:3372)
at android.app.ActivityThread.access$1000(ActivityThread.java:164)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1369)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:147)
at android.app.ActivityThread.main(ActivityThread.java:5513)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:971)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:766)
现象:
页面白屏,按home键是出现以上异常
问题原因:
执行反注册时,如果content为空,就会出现无限暂时。
本人的反注册放在onDestroy中,执行完onDestroyView后,卡在了onDestroy。
解决方法:
判断content是否为空。