Search code examples
androidprogressdialog

ProgressDialog in Android for new Activity


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.


Solution

  • See the answer here

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