Unwanted white bar at the bottom sometimes appears, sometimes not
<p>I'm trying to create an Android game using Android Studio. 
However when I'm testing the app from the Android Studio(using my phone as a testing device), there's a white bar which appears at the bottom of the screen. If I switch to another activity and then go back to my main activity, the white bar will dissappear. </p>

<p>Here is my Main Activity XML:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
tools:context="acevix.gladiators3.MainActivity"&gt;

&lt;ImageView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:srcCompat="@drawable/splash"
    android:id="@+id/imageView"
    android:scaleType="centerCrop"
    android:layout_alignParentBottom="true"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true"
    android:adjustViewBounds="true" /&gt;

&lt;Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_centerHorizontal="true"
    android:layout_marginBottom="140dp"
    android:id="@+id/play"
    android:background="@drawable/play" /&gt;

&lt;TextView
    android:text="GLADIATORS PRE-ALPHA V0.0.1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true"
    android:id="@+id/textView" /&gt;

&lt;/RelativeLayout&gt;
</code></pre>

<p>And here's my styles.xml file, which I've edited in order to remove some UI:</p>

<pre><code>&lt;resources&gt;

&lt;!-- Base application theme. --&gt;
&lt;style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"&gt;
    &lt;!-- Customize your theme here. --&gt;
    &lt;item name="colorPrimary"&gt;@color/colorPrimary&lt;/item&gt;
    &lt;item name="colorPrimaryDark"&gt;@color/colorPrimaryDark&lt;/item&gt;
    &lt;item name="colorAccent"&gt;@color/colorAccent&lt;/item&gt;
&lt;/style&gt;
</code></pre>

<p></p>

<p>Activity code:</p>

<pre><code>package acevix.gladiators3;

import android.content.Intent;
import android.media.MediaPlayer;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;

public class MainActivity extends AppCompatActivity {

MediaPlayer splashbgmusic;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    Button playButton = (Button) findViewById(R.id.play);

    DisplayMetrics displaymetrics = new DisplayMetrics();
    getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
    int height = displaymetrics.heightPixels;
    int width = displaymetrics.widthPixels;

    playButton.setY((float) (height/4.4));
    playButton.getLayoutParams().height = (int) (height / 5.14);
    playButton.getLayoutParams().width = (int) (width / 3.47);



    playButton.setOnClickListener(
            new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    //Log.d("SIZE", "Height " + view.getHeight() + ", Width: " + view.getWidth());
                    Intent intent = new Intent(MainActivity.this, PlayStage.class);
                    startActivity(intent);
                }
            }
    );
}

@Override
protected void onStart() {
    super.onStart();
}

@Override
protected void onResume() {
    super.onResume();
    splashbgmusic = MediaPlayer.create(MainActivity.this, R.raw.login);
    splashbgmusic.setLooping(true); // Set looping
    splashbgmusic.setVolume(1.0f, 1.0f);
    splashbgmusic.start();
}

@Override
protected void onPause() {
    super.onPause();
    splashbgmusic.stop();
}

@Override
protected void onStop() {
    super.onStop();
    splashbgmusic.stop();
}


@Override
public void onWindowFocusChanged(boolean hasFocas) {
    super.onWindowFocusChanged(hasFocas);
    View decorView = getWindow().getDecorView();
    if(hasFocas) {
        decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE
        | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
        | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
        | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
        | View.SYSTEM_UI_FLAG_FULLSCREEN
        | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
    }
}
</code></pre>

<p>}</p>

<p><strong>UPDATE:</strong> Apparently the problem is caused by the styles.xml file. If I change the "Theme.AppCompat.Light.NoActionBar" to "Theme.AppCompat.Light.DarkActionBar", the white bar won't appear anymore BUT when I switch between activities the blue navigation bar at the top showing the name of the game will appear for a short time and then dissappear.</p>

<p>And here's a youtube video which shows you exactly the problem (annotations included): <a href="https://www.youtube.com/watch?v=lEdkXZRdsu0" rel="nofollow noreferrer">https://www.youtube.com/watch?v=lEdkXZRdsu0</a></p>