Android screen saver white at the beginning?

When I launch my application, I see a white screen for a couple of seconds before the splash screen appears.

I am wondering if the size of my application can affect it (it's 17.7 MB). Or is it because my test device is outdated (HTC Desire HD) and is a bit torn off by too much data?

Or is this normal behavior? Or maybe the problem is in my code below ...

Part of the manifest:

<activity android:name=".SplashView" android:noHistory="true" android:screenOrientation="portrait" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name=".MainActivity" android:label="@string/app_name" android:screenOrientation="portrait" android:windowSoftInputMode="adjustPan" android:configChanges="orientation" > <intent-filter > <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </activity> 

Burst Activity:

 public class SplashView extends SherlockActivity { private final int SPLASH_DISPLAY_LENGHT = 1000; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getSupportActionBar().hide(); setContentView(R.layout.splash_view); try { RefreshRatingsTask urt = new RefreshRatingsTask(); urt.execute(); } catch (Exception e) { // ignore } new Handler().postDelayed(new Runnable() { @Override public void run() { Intent mainIntent = new Intent(SplashView.this, MainActivity.class); SplashView.this.startActivity(mainIntent); SplashView.this.finish(); } }, SPLASH_DISPLAY_LENGHT); } } 

thank

+3
performance android
Jun 19 '13 at 1:15
source share
2 answers

Android uses the theme of your initial action to show dummy activity while it loads your application into memory.

Reducing the size of your application will help reduce the waiting time and using the theme to set the screen saver style will make it less noticeable.

This blog post by Cyril Mottier has more details.

+9
Jun 19 '13 at 1:34 on
source share
  RefreshRatingsTask urt = new RefreshRatingsTask(); urt.execute(); 

This asynthesis seems like a criminal. It may take some time to work, so the splash screen will not appear immediately. Comment on this and retest.
Also, it is not a good practice to do heavy things on spray. Create a service for it and do it in the background.

0
Jun 19 '13 at 1:18
source share



All Articles