title: ProgressDialog throws error in Android when passed an Application
body: <p>I am getting the following exception :</p>
  
  <pre><code>Caused by: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
              at android.view.ViewRootImpl.setView(ViewRootImpl.java:566) ~[na:0.0]
              at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:272) ~[na:0.0]
              at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69) ~[na:0.0]
              at android.app.Dialog.show(Dialog.java:298) ~[na:0.0]
              at kujo.app.ui.VerificationCallingDeviceActivity$2.showDialogIfNotShowing(VerificationCallingDeviceActivity.java:162) ~[na:0.0]
              at kujo.app.ui.VerificationCallingDeviceActivity$2.trySigningIn(VerificationCallingDeviceActivity.java:179) ~[na:0.0]
              at kujo.app.ui.VerificationCallingDeviceActivity$2.onReceiveCalled(VerificationCallingDeviceActivity.java:220) ~[na:0.0]
              at kujo.app.ui.IncomingCall.fireListeners(IncomingCall.java:54) ~[na:0.0]
              at kujo.app.ui.IncomingCall.onReceive(IncomingCall.java:79) ~[na:0.0]
              at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:861) ~[na:0.0]
  </code></pre>
  
  <p>This happens at line where ProgressDialog.show() function gets called.</p>
  
  <p>I have created the ProgressDialog like: </p>
  
  <pre><code>new ProgressDialog(VoipApplication.getInstance().getApplicationContext());
  </code></pre>
  
  <p>Where VoipApplication is a class which extends Application.</p>
  
  <p>In some posts i read that ProgressDialog must be used for an Activity.
  Otherwise this error will come. 
  Is there any alternative that i can try so as to use ProgressDialog. </p>