Remarkable
Remarkable

Reputation: 549

Block main activity until an other finishes

At the very beginning of my application I would like to download some init data (in an AsynchTask) from the network. Therefore I would like to block my main acitvity and start a new one for showing a ProgressDialog to monitor the download process. Unfortunatelly the main activity is not blocked in the background and tries to show the GUI...which is not possible, because it relies on the initial data being downloaded from the net.

How can I block the main activity until the other Acitiviy fininshes?

Upvotes: 0

Views: 160

Answers (1)

legrandviking
legrandviking

Reputation: 2424

I would make sure the main activity(main gui) as you call it only starts when all data has been loaded.

To do so, you could create a simple gui with a progress bar indicating to the user time left before the application starts. This could become your starting UI and once the data is loaded and the progress bar is full, you could then load your main GUi.

Upvotes: 1

Related Questions