I'm currently testing my app with a multipane Fragment
-ised view using the HC compatibility package, and having a lot of difficultly handling orientation changes.
My Host
activity has 2 panes in landscape (menuFrame
and contentFrame
), and only menuFrame
in portrait, to which appropriate fragments are loaded. If I have something in both panes, but then change the orientation to portrait I get a NPE as it tries to load views in the fragment which would be in the (non-existent) contentFrame
. Using the setRetainState()
method in the content fragment didn't work. How can I sort this out to prevent the system loading a fragment that won't be shown?
Many thanks!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…