search

Home  >  Q&A  >  body text

android - FragmentManager是一个什么样的存在?

activity因设备旋转或清理内存而销毁前后FragmentManager都存在吗?为什么要获取的fragment都存在于队列中,这其中是一个什么样的过程?

阿神阿神2772 days ago547

reply all(1)I'll reply

  • 高洛峰

    高洛峰2017-04-17 17:38:42

    The first question: To be precise, it does not exist. The regenerated Activity after destruction will build a new FragmentManager instance, but the old Activity will save the Fragment instance that was retained in the FragmentManager before destruction through the onRetainNonConfigurationInstance() method, and then Restore these Fragment instances after the Activity is recreated

    I don’t quite understand your second question, can you explain it in detail?

    reply
    0
  • Cancelreply