Displaying a progress dialog box when creating a view for android activity

In android activity, I have a lengthy process of building a report (viewing). I want to show the progress dialog "Generate report ... Wait" while the view is being created. Is it possible to start and activate an action (on-screen switch) and then display a progress dialog and present a view?

I suggest that as an alternative, I could create a view on the background thread from the main action, showing a progress dialog, and then after creating the view, I could start the next action and present the constructed view.

What is the best way to deal with something like this i.e. show feedback when building a complex view? A view should be built in code, not XML, but with iterations of data, this can be a few seconds. I want the app to look responsive.

Thank.

+3
source share
1 answer

I get it. I show a run dialog and then run a background task that has setcontentView in the RunOnUiThread element and hides the run dialog.

+1
source

All Articles