title: getActionBar() returns null in PreferenceActivity (AppCompat-v7 21)
body: <p>I have implemented DoneBar (two buttons in actionbar) in <code>PreferenceActivity</code> as provided in v20 sdk samples, but after updating SDK and AppCompat to version 21 my app crashes at </p>
  
  <p><code>java.lang.NullPointerException: Attempt to invoke virtual method 'void android.app.ActionBar.setDisplayOptions(int, int)' on a null object reference</code> </p>
  
  <p>That is because <code>getActionBar()</code> returns null. And There is no <code>getSupportActionBar()</code> as in <code>ActionBarActivity</code>. </p>
  
  <p>So my question is how to get that actionbar object in <code>PreferenceActivity</code> so I could apply custom view on it?</p>
  
  <p>SOLVED</p>
  
  <p>After some research I managed to solve this problem by using <code>PreferenceFragment</code> with <code>ActionBarActivity</code> so I could call <code>getSupportActionBar()</code></p>