title: Android ActionBar issue different API < > 21
body: <p>Having issue with ActionBar NullPointerException based on different API. All my activities extend <code>Activity</code> .</p>
  
  <p>This is my code:</p>
  
  <p>Gradle</p>
  
  <pre><code>minSdkVersion 17
  targetSdkVersion 23    
  
  compile 'com.android.support:appcompat-v7:23.1.1'
  compile 'com.android.support:support-v4:23.1.1'
  compile 'com.android.support:design:23.1.1'
  </code></pre>
  
  <p>Styles:</p>
  
  <pre><code>&lt;style name="AppTheme" parent="Theme.AppCompat.Light"&gt;
  </code></pre>
  
  <p>Styles (values-v21):</p>
  
  <pre><code>&lt;style name="AppTheme" parent="android:Theme.Material.Light"&gt;
  </code></pre>
  
  <p>Activity:</p>
  
  <pre><code>ActionBar actionBar = getActionBar();
  assert actionBar != null;
  actionBar.hide();
  </code></pre>
  
  <p>It works fine on <strong>API23</strong> but give <code>NullPointerException</code> on lower.</p>
  
  <p>Read other similar question, tried with <code>ActionBarActivity</code> (deprecated), <code>AppCompatActivity</code>, <code>SupportActionBar</code> but I am not able to let it works on different API.</p>
  
  <p>Any suggestions? Any help would be much appreciated. Thanks in advance.</p>