set notification on alarm receiver android
<p>In my android application i would like to set an alaram programmatically.
Setting alarm is working properly but how can i apply notification to this on recieving alarm.</p>

<p>I have gone through notifications in developer guide.</p>

<p>Please find the code.</p>

<pre><code>Calendar cal=Calendar.getInstance();
    Intent alaram=new Intent(Alarmmanager.this,GroupsCheckAlarmReceiver.class);
    PendingIntent pendingIntent = PendingIntent.getBroadcast(Alarmmanager.this, 0, alaram,0);
    AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);
    alarmManager.set(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(),pendingIntent); 
    cal.setTimeInMillis(System.currentTimeMillis()); 

    sendBroadcast(alaram,"setalaram");
</code></pre>

<p>and in broadcast receiver</p>

<pre><code>public class GroupsCheckAlarmReceiver extends BroadcastReceiver{ 

@Override 
 public void onReceive(final Context context, Intent intent) { 
 Toast.makeText(context, "Alarm worked.", Toast.LENGTH_LONG).show(); 

 } 
</code></pre>

<p>It is working fine but to set notification i need to set notification manager which works fine only in activity extended class ,how can i use it on receive and notify.</p>

<p>Please share your valuable suggestions.</p>

<p>Thanks in advance :)</p>
