https://blog.csdn.net/haoyuegongzi/article/details/104118525)
if (!isTaskRoot() && getIntent().hasCategory(Intent.CATEGORY_LAUNCHER) && getIntent().getAction() != null && getIntent().getAction().equals(Intent.ACTION_MAIN)) {
finish();
return;
}
Locale locale;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
locale = LocaleList.getDefault().get(0);
} else locale = Locale.getDefault();
return locale.getLanguage() + "-" + locale.getCountry();
DeviceBrandTools deviceBrandTools = DeviceBrandTools.getInstance();
if (deviceBrandTools.isMiui() && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
window.getDecorView().setSystemUiVisibility(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);
} else {
window.getDecorView().setSystemUiVisibility(systemUiVisibility);
}