0

I have to initialize data for Android Application, initialization does a service call, it is taking time. I have coded all the initialization in Application.onCreate(). It is taking time to reach Activity.onCreate() (launcher activity) I can see the black screen for some time, then loading view is appearing which is in an Acitivy.onCreate().

Is there anyway to show the splash screen when the Application oncreate is running.

Navin GV
  • 700
  • 3
  • 10
  • 24

1 Answers1

0

First load your Activity then in on create using AsyncTask call and initialize your variables. So that you can avoid the black screen. You can get more information about AsyncTask from here http://developer.android.com/reference/android/os/AsyncTask.html

Good example from here

Example

Hope this helps you

Community
  • 1
  • 1
itsrajesh4uguys
  • 4,610
  • 3
  • 20
  • 31
  • yeah i thought about it. I also tried this. But i am having home screen widget for my app. The widget also needs all the data to be initialized. – Navin GV Jun 04 '13 at 06:32