Question: For some reason, in API 21, the app crashes every time i use a theme of "no action bar".

I saw here in another question that i should add `this.getActionBar().hide();`, so i tried it with a several different themes but it's not working.

Can someone explain to me why this is happening and what's the solution for that?

Answer: 
If you're getting a NullPointerException on

```
    this.getActionBar().hide();

```

then that means your Activity has no Action Bar.

Hiding the system bars has been changed since KitKat. If you're trying to go into full screen mode you'll probably have to play around with the System UI Visibility flags. Check out the training pages here: <https://developer.android.com/training/system-ui/status.html>
Modify your styles.xml using this theme

```
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <!-- the theme applied to the application or activity -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="android:windowNoTitle">true</item>
    </style>
</resources>

```

If your Activity extends `ActionBarActivity` then 

`getSupportActionBar().hide();`

Hope it helps!!!