1

I am trying to remove white screen before splash so i followed solutions mentioned in these links

How To fix white screen on app Start up?

White screen before splashscreen

I tried almost every solution mentioned here

which includes changing activity theme to this

 android:theme="@android:style/Theme.Translucent.NoTitleBar"

or adding this to my theme

<item name="android:windowDisablePreview">true</item>

but implementing any of this freezes the UI for a while on click of the App icon after that everything works fine as desired.

Has anyone succeeded to fix this lag. Any help will be appreciated.

Community
  • 1
  • 1
Harry Sharma
  • 2,190
  • 2
  • 15
  • 41
  • 1
    Might as well look here [Launch Screen pattern]: https://www.bignerdranch.com/blog/splash-screens-the-right-way/ – Shaishav Aug 08 '16 at 06:25
  • Thanks for the reply @Shaishav but i can't follow all the guidelines mentioned here as my splash screen is dynamic i.e things keep on changing in this screen :( – Harry Sharma Aug 08 '16 at 06:44
  • Anyone downvoting this question.Kindly help me to get the solution.If you find this question improper feel free to edit it.Thanks. – Harry Sharma Aug 08 '16 at 07:25
  • @Shaishav Thanks your answer has shown me the right way. It definitely helped. – Harry Sharma Aug 09 '16 at 12:03

3 Answers3

0

create a custom theme like,

 //splashTheme
 //create in styles
 <style name="splashTheme" parent="AppTheme">
    <!-- Customize your theme here. -->

    <item name="windowActionBar">false</item>
    <item name="windowNoTitle">true</item>

</style>

and then apply the theme as follows,

 //manifest file
 <activity
        android:name=".SplashActivity"

        android:theme="@style/AppTheme.splashTheme"
        android:windowSoftInputMode="adjustResize|stateHidden" />

try this.

Dnyanesh
  • 331
  • 3
  • 12
0

following changes work for me on mac:

1.Goto android studio preferences.
2.In Build,Execution and Deployment select "Instant run".
3.disable-Enable instant run to hot swap code/resource changes on deploy.
4.apply changes,clean project and rebuild again.
Sangram Haladkar
  • 707
  • 9
  • 22
0

Finally got my answer Splash Screen in Right Way. I do just following.

In values-->styles.xml I created splash screen background image

<style name="Splash" parent="AppTheme.NoActionBar">
    <item name="android:windowBackground">@drawable/splash</item>
</style>

For below api 19, in values-19->styles.xml I used

<style name="Splash" parent="AppTheme.NoActionBar">
    <item name="android:windowBackground">@drawable/splash</item>
    <item name="android:windowTranslucentStatus">true</item>
    <item name="android:windowTranslucentNavigation">true</item>
</style>

I removed setContentview() from SplashActivity and added style for splash screen in Manifest.xml file android:theme="@style/Splash"