How to create an alert dialog just after the phone hangs up in android?
<p>I need to show some alert after the user have finished his call.</p>

<p>I created a receiver which monitors this.Now i want to show some alert.But i am not able to show it.Maybe because the context which i am using is wrong...</p>

<p>This is my code....</p>

<pre><code>@Override
public void onReceive(Context context, Intent intent) {
    Bundle bundle = intent.getExtras();

    if (null == bundle)
        return;

    String phonenumber = intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER);

    Log.i("OutgoingCallReceiver", phonenumber);
    Log.i("OutgoingCallReceiver", bundle.toString());
    if(phonenumber.equals("10000"))
    {

        AlertDialog alertDialog = new AlertDialog.Builder(context).create();
        alertDialog.setTitle("Caution");
        alertDialog.setMessage("Data Usage Exceeded");
        alertDialog.setButton("OK", new DialogInterface.OnClickListener() {
          public void onClick(DialogInterface dialog, int which) {
            return;
        } });
        setResultData(null);

    }
}
</code></pre>
