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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With