forum

Home / DeveloperSection / Forums / Broadcast not recieved when called by an intent

Broadcast not recieved when called by an intent

Norman Reedus 2021 17-Nov-2014

I have broadcast which is recieved on system boot as well as by an intent. 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 :
@Override
public 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>


Updated on 17-Nov-2014

Can you answer this question?


Answer

1 Answers

Liked By