Error adding ProgressDialog

3

I'mhavingtroubleaddingadialoginthislistViewmethod,isthereanotherwaytomakeitwork?

listDebitosPendentes.setOnItemClickListener(newAdapterView.OnItemClickListener(){dialog=ProgressDialog.show(DetalhesDebitosActivity.this,"Aguarde","Enviando Boleto....",true);
    @Override
    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {              
        Intent intent= new Intent(getApplicationContext(),DetalhesDebitosActivity.class);
        //Passa para a activity o id no banco de dados
        intent.putExtra("ID",id);
        startActivity(intent);

    }
});
    
asked by anonymous 06.12.2016 / 19:40

1 answer

2

Try using this code to show an indefinite progress bar that shows a spinner:

dialog = new ProgressDialog(DebitosPendentesActivity.this);

dialog.setIndeterminate(true);
dialog.setMessage("Enviando Boleto....");
dialog.setTitle("Aguarde");
dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
dialog.show();
    
07.12.2016 / 02:03