title: Exception using ProgressDialog in BroadcastReceiver - token null is not for an application
body: <p><strong>UserStream.java -</strong></p>
  
  <pre><code>public class UserStream extends BroadcastReceiver {
  
  @Override
      public void onReceive(Context context, Intent intent) 
      {
           if(action.equals("com.aser.main.ReceiverConnection")){
              Log.i(TAG, "Received intent from UserInteraction service");
  
              if(intent.getExtras().get("key").equals("startDialog"))
              {
                  System.out.println("the wokring HUD started...");
                  connectionDialog = new ProgressDialog(context);
                  connectionDialog.setMessage("Working ...");
                  connectionDialog.setIndeterminate(false);
                  connectionDialog.setCancelable(false);
                  connectionDialog.show();  //exception here
              }
      }
  </code></pre>
  
  <p><strong>NOTE:</strong></p>
  
  <p>My calling class is a IntentService class with the following code -</p>
  
  <pre><code>Intent intent = new Intent();
  intent.setAction("com.aser.main.ReceiverConnection");
  intent.putExtra("key","startDialog");
  sendBroadcast(intent);
  </code></pre>
  
  <p><strong>Error Log:</strong></p>
  
  <pre><code>12-15 20:48:17.179: E/ACRA(5237): Caused by: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
  12-15 20:48:17.179: E/ACRA(5237):   at android.view.ViewRootImpl.setView(ViewRootImpl.java:588)
  12-15 20:48:17.179: E/ACRA(5237):   at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:326)
  12-15 20:48:17.179: E/ACRA(5237):   at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:224)
  12-15 20:48:17.179: E/ACRA(5237):   at android.view.WindowManagerImpl$CompatModeWrapper.addView(WindowManagerImpl.java:149)
  12-15 20:48:17.179: E/ACRA(5237):   at android.app.Dialog.show(Dialog.java:277)
  12-15 20:48:17.179: E/ACRA(5237):   at com.aser.main.UserStream.onReceive(UserStream.java:73)
  </code></pre>