This is my code
public void DownloadROM(View view) {
progressDialog = new ProgressDialog(ROMManager.this);
progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
progressDialog.setMessage("Downloading ROM Repository\nPlease standby");
progressDialog.show();
gotoList(view);
Log.v("ROMManager", "Showing download List");
}
public void gotoList(final View view){
Thread background = new Thread(new Runnable(){
public void run() {
Intent i = new Intent(ROMManager.this, DownloadList.class);
startActivity(i);
}
});
background.start();
}
Problem is that when I call DownloadROM, the progress dialog appears, but the Spinner doesn’t move, this is my last try, before was only 1 method
Thanks.
Not sure but maybe the problem is that the activity who launched the progressDialog isn’t in “focus” anymore but DownloadList activity is.
Maybe you can try handle the progressDialog in the DownloadList Activity.
Edit:
You need to show the progress dialog at the very start of your 2nd Activity, not your first one. And you need to do your data download work in an AsyncTask.
Source