Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SYSTEM_UI_FLAG_LOW_PROFILE not working on HTC One M8

Tags:

android

I've received reports from some users with HTC One M8 phones, that the navigation buttons are always visible even though they should be in low profile mode.

I built the following sample app, which works like you'd expect on the emulator and on my Nexus 4.

public class MainActivity extends Activity implements View.OnClickListener {

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

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.visible:
                getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
                break;
            case R.id.lowProfile:
                getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
                break;
        }
    }

}

On a HTC One M8 the SYSTEM_UI_FLAG_LOW_PROFILE flag is always ignored, but hiding the status bar for example (with SYSTEM_UI_FLAG_FULLSCREEN) works.

I've tried calling setSystemUiVisibility() on the decor view as shown and on a button without success.

Are there any known issues or workarounds for that model?

Update: The sample app was tested on Android 5.0.1. I don't know if it worked on previous versions.

like image 826
Gubbel Avatar asked Aug 26 '15 20:08

Gubbel


Video Answer


1 Answers

It seems like this is a bug related to API 21. The suggestion is to target SDK version 19, and the issue seems to be resolved.

like image 89
PearsonArtPhoto Avatar answered Oct 03 '22 14:10

PearsonArtPhoto