alert builder 中的 Token 不为空

我使用一个 receiver 每周来创建一个 alertbox。但是确获得错误:

Unable to add window -- token null is not for an application

代码如下:

public class AlarmReceiver extends BroadcastReceiver 
    {
         @Override
         public void onReceive(Context context, Intent intent) 
         {
           try {
                 displayAlert("Have you seen your chiropractor this month?", "Alert!", context);
                } 
           catch (Exception e) 
            {
               Toast.makeText(context, "There was an error somewhere, but we still received an alarm", Toast.LENGTH_SHORT).show();
                 e.printStackTrace();
              }
        }
         public void displayAlert(final String error, String title, final Context context)
         {
                new AlertDialog.Builder(context.getApplicationContext()).setMessage(error)  
                .setTitle(title)  
                .setCancelable(true)  
                .setNeutralButton("Continue",  
                   new DialogInterface.OnClickListener() {  
                   public void onClick(DialogInterface dialog, int whichButton){
                           dialog.cancel();
                            Intent newIntent = new Intent(context, Appointment.class);
                            context.startActivity(newIntent);
                   }  
                   })  
                .show(); 
            }
    }

我创建了一个blank activity MYExtraActivity,然后在 Receiver 中调用

Intent newIntent = new Intent(context, MYExtraActivity .class);
                            context.startActivity(newIntent);

context.getApplicationContext() 不需要使用这个 直接context就行了 Dialog是依托于Activity的生命周期,不是ApplicationContext