I have scheduled alarm for my application.
I have implemented broadcast receiver to be triggered once the alarm time reaches.
How to manually call broadcast re
How to manually call broadcast receiver to execute the code inside of onReceive method without replicating the code twice.
Fire BroadcastReceiver
using sendBroadcast
same action which added in AndroidManifest.xml
:
Intent intent=new Intent(CUSTOM_ACTION_STRING);
// Add data in Intent using intent.putExtra if any required to pass
sendBroadcast(intent);
what is that android:exported parameter means
As in android:exported doc : Whether or not the broadcast receiver can receive messages from sources outside its application — "true" if it can, and "false" if not
Means if:
android:exported=true: other application also able to fire this broadcast receiver using action
android:exported=false: other application not able to fire this broadcast receiver using action