title: how to create alertdialog outside of an application?
body: <p>I want to create an alertdialog outside of my application.</p>
  
  <pre><code>AlertDialog.Builder builder = new AlertDialog.Builder(context);
      builder.setTitle(Config_ConstantVariable.latest);
      builder.setMessage(title);
      builder.setIcon(R.drawable.push_logo);
      builder.setCancelable(false)
              .setPositiveButton(Config_ConstantVariable.alertbtnyes,
                      new DialogInterface.OnClickListener() {
                          public void onClick(DialogInterface dialog, int id) {
                              Intent intent = new Intent(context,
                                      Main_ParticularNewsDetail.class);
                              Bundle bundle = new Bundle();
                              intent.putExtra("newsid", payload);
                              intent.putExtras(bundle);
                              context.startActivity(intent);
                          }
                      })
              .setNegativeButton(Config_ConstantVariable.alertbtnno,
                      new DialogInterface.OnClickListener() {
                          public void onClick(DialogInterface dialog, int id) {
                              dialog.cancel();
                          }
                      });
      AlertDialog alert = builder.create();
      alert.show();
  </code></pre>
  
  <p>However, the <code>context</code> is not an activity and this class is <code>extends BroadcastReceiver</code>.</p>
  
  <p>When I push notification, an error occured,</p>
  
  <pre><code>06-18 18:38:08.629: E/AndroidRuntime(2402): Caused by: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
  </code></pre>
  
  <p>I saw WhatsApp that can pop out the dialog outside the application in samsung galaxy tab.</p>