title: Issues with dual-pane preference screens
body: <p><strong>Problem</strong><br/>
  Rotating a device from a one-pane portrait <code>PreferenceScreen</code> to a two-pane landscape <code>PreferenceScreen</code>, causes landscape to only show as one-pane. Does NOT occur when viewing the headers screen.</p>
  
  <p><strong>Setup</strong><br/>
  This is for ICS and up only. I have a <code>PreferenceActivity</code> which loads <code>preference-headers</code>. Each header links with a <code>Fragment</code>, which in turn loads a <code>PreferenceScreen</code>. Pretty run of the mil. </p>
  
  <p><strong>Details</strong><br/>
  Everything worked well until I noticed that Android will only auto-switch to a two-pane look for certain screens. After some research I learned from a <a href="http://commonsware.com/blog/2012/10/16/conditional-preference-headers.html">Commonsware post</a> that Android will only do so for sw720dp. Bit of a waste if you ask me since many devices def have plenty of room for two-panes.  So I overrided the <code>onIsMultiPane()</code> method to return true for w600dp and up.  Worked like a charm....kinda.</p>
  
  <p>Given a device which will show single-pane in portrait and dual-pane in landscape; viewing the headers in portrait and rotating to landscape, works fine.  However if one selects a header and loads it's subsequent screen in portrait mode, then rotate to landscape the device will stay single-pane instead of switching back to dual-pane. If you then back navigate to the headers screen, it'll return to a dual-pane look except that it won't pre-select a header. As a result the detailed pane stays blank.</p>
  
  <p>Is this intended behavior? Anyway to work around it?  I tried overriding <code>onIsHidingHeaders()</code> as well but that just caused everything to show a blank screen.</p>
  
  <p><strong>Code</strong><br/>
  Preference Activity: <br/></p>
  
  <pre><code>public class SettingsActivity extends PreferenceActivity {
  @Override
  public void onBuildHeaders(List&lt;Header&gt; target) {
      super.onBuildHeaders(target);
      loadHeadersFromResource(R.xml.preference, target);
  }
  
  @Override
  public boolean onIsMultiPane() {
      return getResources().getBoolean(R.bool.pref_prefer_dual_pane);
  }
  }
  </code></pre>
  
  <p><br/>
  A Preference Header Frag:<br/></p>
  
  <pre><code>public class ExpansionsFragment extends PreferenceFragment {
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      addPreferencesFromResource(R.xml.pref_expansions);
  }
  
  public static ExpansionsFragment newInstance() {
      ExpansionsFragment frag = new ExpansionsFragment();
  
      return frag;
  }
  }
  </code></pre>