ProgressDialog in Android for new Activity
Asked Answered
E

1

4

When the user taps a menu item I need to create a new Activity. This Activity loads a lot of data then shows a map and takes some seconds to be shown. How can I use ProgressDialog from an activity to another? I actually cannot see it if I call

ProgressDialog dialog = ProgressDialog.show(this, "", "Loading. Please wait...", true);

Thanks in advance.

Endbrain answered 10/11, 2010 at 11:40 Comment(0)
E
1

See the answer here

You should use your AsyncTask in onCreate() method of the Activity you start from menu.

Emblazonment answered 10/11, 2010 at 11:58 Comment(1)
I have the same issue, but I don't see how AsyncTask is used correctly. It seems that the ProgressDialog doesn't start drawing until the new Activity is completely finished being created (through an AsyncTask). By then the ProgressDialog is no longer needed.Ampulla

© 2022 - 2024 — McMap. All rights reserved.