I have an android app which displays a white screen for 2 seconds on startup. My other apps don't do this, but this one does. I have also implemented a splashscreen with the hope that it would fix this. Should I increase my splash screen sleep time? Thanks.
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
Both properties works use any one of them.
This is my AppTheme on an example app:
As you can see, I have the default colors and then I added the
android:windowIsTranslucent
and set it totrue
.As far as I know as an Android Developer, this is the only thing you need to set in order to hide the white screen on the start of the application.
i also had the same problem in one of my project. I resolved it by adding some following parameters in the theme provided to the splash screen.
You can find the reason and resolution in this blog post written by me. Hope it helps.
Like you tube.. initially they show icon screen instead of white screen. And after 2 seconds shows home screen.
first create an XML drawable in res/drawable.
Next, you will set this as your splash activity’s background in the theme. Navigate to your styles.xml file and add a new theme for your splash activity
In your new SplashTheme, set the window background attribute to your XML drawable. Configure this as your splash activity’s theme in your AndroidManifest.xml:
This link gives what you want. step by step procedure. https://www.bignerdranch.com/blog/splash-screens-the-right-way/
UPDATE:
The
layer-list
can be even simpler like this (which also accepts vector drawables for the centered logo, unlike the<bitmap>
tag):Put this in a custom style and it solves all the problems. Using the hacky translucent fix will make your task bar and nav bar translucent and make the splashscreen or main screen look like spaghetti.
<item name="android:windowDisablePreview">true</item>
Below is the link that suggests how to design Splash screen. To avoid white/black background we need to define a theme with splash background and set that theme to splash in manifest file.
https://android.jlelse.eu/right-way-to-create-splash-screen-on-android-e7f1709ba154
splash_background.xml inside res/drawable folder
Add below styles
In Manifest set theme as shown below