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();
}
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();
}
Very useful example.Thanks
ReplyDeletehere is another useful example that lets you use ProgressDialog using threads and async tasks also . http://blog.creatiosoft.com/?p=1316