title: Create global ProgressDialog
body: <p>I have created common function for displaying custom progressbar in another class. When i call this function Dialog box will be shown but when i want to dismiss that Dialog box than it could not be dismissed. Here is the code</p>
  
  <pre><code>public void showPopupProgressSpinner(Boolean isShowing) {
  
          Dialog progressDialog;
          ProgressBar progressBar;
  
          progressDialog = new Dialog(context);
          progressDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
          progressDialog.setContentView(R.layout.popup_progressbar);
          progressDialog.setCancelable(false);
          progressDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
  
          progressBar = (ProgressBar) progressDialog.findViewById(R.id.progressBar1);
          progressBar.getIndeterminateDrawable().setColorFilter(Color.parseColor("#ff6700"),
                  android.graphics.PorterDuff.Mode.MULTIPLY);
  
          if (isShowing == true) {
              progressDialog.show();
          } else if (isShowing == false) {
  
              progressDialog.dismiss();
  
          }
      }
  </code></pre>
  
  <p>This is how i call this function<br><br>
  <strong>To show dialog box</strong><br></p>
  
  <pre><code>utils.showPopupProgressSpinner(true);
  </code></pre>
  
  <p><strong>To Hide dialog box</strong><br></p>
  
  <pre><code>utils.showPopupProgressSpinner(false);
  </code></pre>