tags:

views:

178

answers:

1

hi,
When i start my application initially ,i get a black screen which stays for a few seconds before my main activity starts.In case of iphone an image with name default is displayed for that split second.I am not sure how to do the same in android.Any help .I tried as below in vain

         <activity android:name=".Index"
              android:label="@string/app_name"
              android:screenOrientation="portrait"
              android:theme="@drawable/defaultimage">
            <intent-filter>
              <action android:name="android.intent.action.MAIN" />
              <category android:name="android.intent.category.LAUNCHER" />
          </intent-filter>
        </activity>  
+4  A: 

I guess you have a heavy operation on the onCreate method of your "Index" Activity.

You should put the heavy operations on a thread and make a splash screen with the image, and when the thread is finished, load the menu or whatever you need.

You can make a "loading screen" for example. It's really easy with Android: http://developer.android.com/intl/fr/guide/appendix/faq/commontasks.html#progressbar or http://developer.android.com/intl/fr/reference/android/widget/ProgressBar.html

YaW
thanks you for your comments ,i have 30 images icons on my home screen and i wrote onclick listeners for all those images like ImageView img1;img1.setOnClickListener(new ImageView.OnClickListener() { public void onClick(View v) { Intent explicitIntent = new Intent(Index.this,xxx.yyy.zzz.MyActivity.class); startActivity(explicitIntent); } }); i doubt how to use thread in this case.
ganesh
i got the answer from http://android-developers.blogspot.com/2009/03/window-backgrounds-ui-speed.html.
ganesh