Thursday, 15 September 2016

Android black screen before splash appear | Black screen on app start | How to avoid black screen in android while app is loading?


Hello Friends,
          Have you facing the delay issue on app launch and black/white
screen will be appearingfor few seconds. Here is the solution of this
issue.

1. Inside styles.xml add below style:
     
     <style name="Theme.AppCompat.Light.NoActionBar.FullScreen"
    parent="@android:style/Theme.Black.NoTitleBar">
   <item name="windowNoTitle">true</item>
   <item name="windowActionBar">false</item>
   <item name="android:windowFullscreen">true</item>
   <item name="android:windowContentOverlay">@null</item>
   <item name="android:windowIsTranslucent">true</item>
</style>

2. Inside your AndroidManiest.xml file add above style to your  Splash Activity:
    <activity
    android:configchanges="orientation|
    keyboardHidden|screenSize"
    android:label="@string/app_name"
    android:name=".SplashScreenActivity"
    android:screenorientation="portrait"
    android:theme="@style/Theme.AppCompat.Light.NoActionBar.FullScreen">
       <intent-filter>
        <action android:name="android.intent.action.MAIN">
            <category android:name="android.intent.category.LAUNCHER">
            </category></action></intent-filter>
 </activity>


Hope, this will helps someone.
Enjoy Coding... Cheers.. :)



Mukesh Yadav

Hi Guys I am from Delhi working as Web/Mobile Application Developer(Android Developer), also have knowledge of Roboelctric and Mockito ,android test driven development... Blogging has been my passion and I think blogging is one of the powerful medium to share knowledge and ideas....

2 comments:

  1. I am facing one problem
    In my home screen i have videoview. in that videoview background display phone wallpaper. what should i do ?

    ReplyDelete
  2. Where can i find these xml files can you help me please?

    ReplyDelete

 

Copyright @ 2013 Android Developer Blog.

Blog Widget by LinkWithin