---
title: "Broadcast not recieved when called by an intent"  
description: "Broadcast not recieved when called by an intent"  
author: "Norman Reedus"  
published: 2014-11-17  
updated: 2014-11-17  
canonical: https://www.mindstick.com/forum/12606/broadcast-not-recieved-when-called-by-an-intent  
category: "android"  
tags: ["android activity"]  
reading_time: 1 minute  

---

# Broadcast not recieved when called by an intent

I have [broadcast](https://www.mindstick.com/articles/1633/broadcastreceiver-in-android) which is recieved on [system](https://www.mindstick.com/articles/23411/the-most-effective-method-to-find-the-perfect-small-business-phone-system-for-your-business) boot [as well as](https://www.mindstick.com/interview/2481/can-you-write-a-java-class-that-could-be-used-both-as-an-applet-as-well-as-an-application) by an [intent](https://www.mindstick.com/forum/33890/examples-of-intent-and-bundles). This broadcast is to set alarm.

```
Intent intent = new Intent();intent.setAction("recievers.BroadCastBootRec");intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES);getActivity().sendBroadcast(intent);My Broadcast class :@Overridepublic void onReceive(Context context, Intent intent) {    c = context;    Log.d("HirakDebug", "BroadCast Recieved");    getDatesFromDatabase();    getDateDifference();    setAlarmI();}
```

## Manifest.xml

```
<receiver android:name=".recievers.BroadCastBootRec"        android:label="BootReceiver">    <intent-filter>        <action android:name="android.intent.action.BOOT_COMPLETED" />        <category android:name="android.intent.category.DEFAULT"/>    </intent-filter></receiver>
```

## Replies

### Reply by Anonymous User

You have to register two actions and to make things clear. android:name is the Class name of the receiver you had written, not the action. So, for the below receiver your receiver class name will be "BroadCastBootRec"

```
<receiver android:name=".recievers.BroadCastBootRec"    android:label="BootReceiver"><intent-filter>    <action android:name="com.example.BroadCastBootRec" />    <action android:name="android.intent.action.BOOT_COMPLETED" />    <category android:name="android.intent.category.DEFAULT"/></intent-filter></receiver>Intent intent = new Intent();intent.setAction("com.example.BroadCastBootRec");intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES);getActivity().sendBroadcast(intent);
```

The android system will inform your receiver when ever an action **BOOT_COMPLETED** and**com.example.BroadCastBootRec** is triggered

public class BroadCastBootRec extends BroadcastReceiver

```
  @Override  public void onReceive(Context context, Intent intent) {   c = context;   Log.d("HirakDebug", "BroadCast Recieved");   getDatesFromDatabase();   getDateDifference();   setAlarmI();}}
```


---

Original Source: https://www.mindstick.com/forum/12606/broadcast-not-recieved-when-called-by-an-intent

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
