Why is AppTheme.NoActionBar not working? : <p>I've created an Android app in Android Studio, and it has created these styles by default:</p>

<pre><code>&lt;style name="AppTheme.NoActionBar"&gt;
    &lt;item name="windowActionBar"&gt;false&lt;/item&gt;
    &lt;item name="windowNoTitle"&gt;true&lt;/item&gt;
&lt;/style&gt;
</code></pre>

<p>However, in an activity, I try to set this as a theme:</p>

<pre><code>&lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
   ...
android:theme="@style/AppTheme.NoActionBar"&gt;
</code></pre>

<p>But when I run the app I'm getting the action bar:</p>

<p><a href="https://i.stack.imgur.com/dVFTn.png" rel="noreferrer"><img src="https://i.stack.imgur.com/dVFTn.png" alt="enter image description here"></a></p>

<p>Why am I getting an action bar? Am I doing something obviously wrong, or is Android Studio, Google's official IDE for it's own platform, trying to confuse/mislead its developers?</p>

<p>Here is my activity code, there's nothing in it that can cause the action bar to appear by itself:</p>

<pre><code>public class WelcomeActivity extends AppCompatActivity {
    @Override
    public void onCreate(Bundle savedInstanceState, PersistableBundle persistentState) {
        super.onCreate(savedInstanceState, persistentState);
        setContentView(R.layout.activity_welcome);
    }
}
</code></pre>
