-3

I know this has been asked many times but I really never understood any of the answers.

I have an activity and it is doing lot of work on the onCreate() hence it takes a while to load the activity. From what I have seen, people are telling to use Async tasks. I have put all my online loading into async tasks (started it in onCreate) but all my sql database operations are done on the main thread since I need to load the results into lists, etc. Most of these are done onClicks of buttons etc.

Is there any way to speed the loading of the activity up? Can I load the UI elements on a separate thread so the activity is created?

Alok Narasiman
  • 144
  • 1
  • 8

1 Answers1

0

By the sounds of it, your activities are doing too much in their onCreate method. Try moving some of the activities setup (including loading images etc) into AsyncTaks. This should hopefully reduce the load time of your activities.