SendBroadcast() doesn't work in on receive of Broadcast
<p>I have the main activity, that execute a service. In this service, I init a BroadcastReceiver (alarm).</p>

<p>Then I need send briadcast from the onReceive method of alarm broadcst, but doesn't work. But if I execute sendBroadcast() of other method in alarm, work perfectly.</p>

<p>See de code for explain me:</p>

<p><strong>Activity</strong> (init service and get broadcastReceiver)</p>

<pre><code> private final BroadcastReceiver abcd = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
            //Intent in = getIntent();
            //finish();
            Log.d("sdasd", "onReceive: BROADCAST RECIBIDO!!!");
        }
    };
</code></pre>

<p><strong>Service</strong></p>

<pre><code>alarm alarm = new alarm();
    public void onCreate()
    {
        super.onCreate();
    }

@Override
public int onStartCommand(Intent intent, int flags, int startId)
{            
    alarm.setAlarm(this, tiempo);

    return START_STICKY;
}
</code></pre>

<p><strong>Alarm.class</strong></p>

<pre><code> @Override
    public void onReceive(Context context, Intent intent)
    {

        context.sendBroadcast(new Intent("xyz"));
        Toast.makeText(context, "Alarm !!!!!!!!!!", Toast.LENGTH_LONG).show(); // For example

     }

    public void setAlarm(Context context, int tiempo)
    {
        Log.e("TAG", "setAlarm: ");

        context.sendBroadcast(new Intent("xyz"));

        AlarmManager am =( AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
        Intent i = new Intent(context, alarm.class);
        PendingIntent pi = PendingIntent.getBroadcast(context, 0, i, 0);
        am.setRepeating(AlarmManager.RTC_WAKEUP, System.currentTimeMillis(), tiempo, pi); // Millisec * Second * Minute

    }
</code></pre>

<p>In alarm.class, the sendBroadcast in serAlarm() is executed, but the sendBroadcast in onreceive, doesn't executed. And the toast work perfectly.</p>

<p>Why?</p>