In the XML of my MainActivity, I have programmed it so that it uses a theme with NoActionBar and therefore there is no ac
The accepted answer works only for API Level 16 or lower.
In newer versions, for AlertDialog do the following:
if (Build.VERSION.SDK_INT < 16) {
alert.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
} else {
View decorView = alert.getWindow().getDecorView();
int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);
}