View Spinner Progressidialog?

Asked

Viewed 110 times

1

Well I need to do a long task so I did a Progressdialog to inform such task, however the spinner that should be appearing seems hidden or something.

  protected void onPreExecute (){
        progress.setProgressStyle(ProgressDialog.STYLE_SPINNER);
        progress = ProgressDialog.show(Login.this, "Aguarde...",
                "Logando...");
        super.onPreExecute();
    }

I already put the code in onCreate() but still n worked, some idea of what is?

1 answer

2


Try As Follows:

    @Override
    protected void onPreExecute() {
        progress = new ProgressDialog(Login.this);
        progress.setTitle("Aguarde");
        progress.setMessage("Logando...");
        progress.show();
    }

In the onCreate, call your Task as follows:

 MinhaTarefa tarefa = new  MinhaTarefa();
 tarefa.execute((Void)null);

This is just an example, adapt your case AsyncTask use parameters to run!

  • I tried it this way and it still didn’t work, but I think I figured out what was causing it, the color of the spinner maybe.

  • sorry to waste your time, but I had not realized that the spinner was white that was the color of my Tint, so I was just doing a style pro Progressdialog and it worked

  • It’s not a waste of time! Relax!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.