How to display AlertDialog in BroadcastReceiver
<p>I am trying to display AlertDialog in one of the methods of the BroadcastReceiver's subclass. My set up is </p>

<pre><code>            if(telisinthedatabase == true){
                 String checkid = dbHelp.getidbySimcardnumber(tel);
                 LayoutInflater mInflater = LayoutInflater.from(thisclasscontext);
                 View statusupdateView = mInflater.inflate(R.layout.statuslayout, null);
                 TextView statustext = (TextView) statusupdateView.findViewById(R.id.statuseditText);
                 String text[] = msg.split("\n");
                 statustext.setText(text[0]+"\n"+text[1]+"\n"+text[2]+"\n"+text[3]);
                 new AlertDialog.Builder(thisclasscontext).setTitle("Current status of the tracker at: "+checkid).setView(statusupdateView)
                 .setPositiveButton("OK", new DialogInterface.OnClickListener() 
                 {                  
                   @SuppressLint("SimpleDateFormat")
                   public void onClick(DialogInterface dialog, int whichButton) 
                   {                    


                   }
                }).show();
            }
</code></pre>

<p>I copy the instance <code>context</code> from the <code>onReceive(Context context, Intent intent)</code> method to <code>thisclasscontext</code>.But the program crashed. What is wrong with my coding? I used the same coding at other activities, it was fine.
Thanks</p>
