How to keep full screen when show popup menu?
<p>I run my app on Tablet, which has both <strong>status bar</strong> (on top of screen) and <strong>navigation bar</strong> (on bottom of screen).
I use this code to make <code>Activity</code> <strong>Full screen</strong>.</p>

<pre><code> public void hideNavigationBar() {
    final View decorView = getWindow().getDecorView();
    decorView.setSystemUiVisibility(setSystemUiVisibility());

}

public static int setSystemUiVisibility() {
    return View.SYSTEM_UI_FLAG_LAYOUT_STABLE
            | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
            | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
            | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
            | View.SYSTEM_UI_FLAG_FULLSCREEN
            | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
}
</code></pre>

<p>Then when I touch a <code>Button</code>, I want to show a <code>PopupMenu</code>. The problem is: when <code>PopupMenu</code> is shown, the <strong>status bar and navigation bar appear</strong>.</p>

<p>I tried to add this line:</p>

<pre><code> getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
</code></pre>

<p>It works for the status bar. But the <strong>navigation bar still appears</strong> when show <strong>PopupMenu</strong>.</p>

<p>How can I keep full screen when show <code>PopupMenu</code>?</p>

<p><strong>EDIT</strong>: Here is the code where I show the <code>PopupMenu</code>:</p>

<pre><code>    ImageView btnOpen = (ImageView) findViewById(R.id.image_view_open);
    btnOpen.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            PopupMenu popupMenu = new PopupMenu(ActivityViewImage.this, v);
            getMenuInflater().inflate(R.menu.context_menu_image, popupMenu.getMenu());
            popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
                @Override
                public boolean onMenuItemClick(MenuItem item) {
                    //do something
                    return true;
                }
            });
            popupMenu.show();
        }
    });
</code></pre>