HI, Im trying to show a ProgressDialog while the activity is loading. my problem is that although i completed all the work in the activity it takes a long time for the activity to load, i suspect this is because i use multiple views with multiple listviews with custom array adapters inside a viewflipper. it takes a long time for the UI to show.
how would i go about checking that all the UI inside the activity finished loading?
or is there a way to preload all the activity and the UI?
Thanks,
Use Asynctask
If you think you need a
ProgressDialog
because your activity is opening too slowly, you have much bigger problems. Android is likely to kill off your activity with an activity-not-responding error.You can either get sophisticated and use Traceview to find your performance issue, or you can just experiment. For example, you can skip setting adapters in your
ListViews
, to confirm that the problem indeed lies there.Jorgesys had the right answer in his now-deleted entry, from what I can tell. I suspect that loading your adapters is taking the time, perhaps in database queries, and you need to move some of that into
AsyncTasks
.