how to avoid blank screen between activities android?
When starting child activity from one activity tha second activity appears good.But in meantime blank screen appears.Why I don't know.Iam loading gps开发者_StackOverflow中文版 related data in oncreate() of second activity.How to avoid blank screen and load quickly.
regards, Rajendar
Well if you are performing a long running operation in onCreate
then the application will take a long time to start. There is no way around it.
As an alternative, could you move the long running code out of onCreate
and into a background thread (as suggested by Fredrik Leijon), and in your onCreate
method just pop up a ProgressDialog
informing the user that the application is loading? Once the thread is complete you can dismiss the dialog and load your normal view.
Change your activity launch mode such as android:launchMode="standard".. Add this code in the corresponding activity which loads with black screen in your manifest file.. It solves your problem..
Try loading the data in a separate thread
Add this line to one of your activities in the Manifest file
android:launchMode="standard"
if you have activity that you want to have only one instance of it then use
android:launchMode="singleTask"
精彩评论