title: Preferences screen using ActionBar Sherlock
body: <p>I'm doing an Android application using <code>ActionBarSherlock</code>.
  My problem is for making preference screen. The <code>onBuildHeader()</code> method on the <code>SherlockPreferenceActivity</code> class is nerver called.</p>
  
  <p>This is my code</p>
  
  <p>preference_headers.xml</p>
  
  <pre><code>&lt;preference-headers xmlns:android="http://schemas.android.com/apk/res/android" &gt;
  &lt;header
      android:fragment="package.fragments.MyPreferenceFragment"
      android:icon="@drawable/bulle"
      android:summary="An example of some preferences."
      android:title="title" /&gt;
  
  &lt;/preference-headers&gt;
  </code></pre>
  
  <p>preferences.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
      android:title="@string/options" &gt;
  
      &lt;PreferenceCategory&gt;
          &lt;SwitchPreference
              android:id="@+id/cb_notif"
              android:defaultValue="false"
              android:key="com.vincent.HTC_Dev.pref.notif"
              android:summaryOff="@string/notifications_off"
              android:summaryOn="@string/notifications_on"
              android:title="@string/notifications" /&gt;
      &lt;/PreferenceCategory&gt;
  
  &lt;/PreferenceScreen&gt;
  </code></pre>
  
  <p>MyPreferenceActivity</p>
  
  <pre><code>public class MyPreferenceActivity extends SherlockPreferenceActivity {
  
  
      @Override
      public void onBuildHeaders(List&lt;Header&gt; target) {
          super.onBuildHeaders(target);
  
          loadHeadersFromResource(R.xml.preference_headers, target);
      }
  
  }
  </code></pre>
  
  <p>MyPreferenceFragment</p>
  
  <pre><code>public class MyPreferenceFragment extends PreferenceFragment implements OnSharedPreferenceChangeListener {
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
  
          addPreferencesFromResource(R.xml.preferences);
          getPreferenceScreen().getSharedPreferences().registerOnSharedPreferenceChangeListener(this);
      }
  
      @Override
      public void onSharedPreferenceChanged(SharedPreferences sharedPreferences,
              String key) {
          // TODO Auto-generated method stub
  
      }
  
  
  }
  </code></pre>