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
1. The way to launch a BroadcastReceiver
manually is by calling
Intent intent = new Intent("com.myapp.mycustomaction");
sendBroadcast(intent);
where "com.myapp.mycustomaction"
is the action specified for your BroadcastReceiver
in the manifest. This can be called from an Activity
or a Service
.
2. It is known that Android allows applications to use components of other applications. In this way, Activity
s, Service
s, BroadcastReceiver
s and ContentProvider
s of my application can be started by external applications, provided that the attribute android:exported = true
is set in the manifest. If it is set to android:exported = false
, then this component cannot be started by an external application. See here.