Friday, 6 July 2012

Android ProgressDialog

ProgressDialog    progressDialog;

protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.beat_work);
        progressDialog = new ProgressDialog(this);
        progressDialog.setMessage(CheckInternetConnection() ? "Connecting" : "Connecting to Internet");
        progressDialog.show();    
       
        //Condition to hide the Dialog
        if(progressDialog.isShowing())
           progressDialog.dismiss();
   }

1 comment:

  1. Very useful example.Thanks
    here is another useful example that lets you use ProgressDialog using threads and async tasks also . http://blog.creatiosoft.com/?p=1316

    ReplyDelete