android 闪屏页面
16lz
2021-12-04
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_splash); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { Window window = getWindow(); View decorView = window.getDecorView(); decorView.setOnApplyWindowInsetsListener(new View.OnApplyWindowInsetsListener() { @TargetApi(Build.VERSION_CODES.KITKAT_WATCH) @Override public WindowInsets onApplyWindowInsets(View v, WindowInsets insets) { WindowInsets defaultInsets = v.onApplyWindowInsets(insets); return defaultInsets.replaceSystemWindowInsets( defaultInsets.getSystemWindowInsetLeft(), 0, defaultInsets.getSystemWindowInsetRight(), defaultInsets.getSystemWindowInsetBottom()); } }); ViewCompat.requestApplyInsets(decorView); //将状态栏设成透明,如不想透明可设置其他颜色 window.setStatusBarColor(ContextCompat.getColor(this, android.R.color.transparent)); } registerMessageReceiver(); // used for receive msg ARouter.getInstance().build(RouterConfig.CURRENT_MAIN).navigation(); finish(); }
更多相关文章
- android Beam
- android Beam
- android wpa_supplicant 调试
- Android之消息推送实现
- Android推送通知指南
- Android推送通知指南
- 【幻灯片分享】Android消息推送实现 | 友盟 徐仙明 | Android(安
- Android(安卓)服务器推送技术
- Android推送通知指南