I would like to start a broadcast receiver from an activity. I have a Second.java file which extends a broadcast receiver and a Main.java file from which I have to initiate
For that you have to broadcast a intent for the receiver, see the code below :-
Intent intent=new Intent();
getApplicationContext().sendBroadcast(intent);
You can set the action and other properties of Intent and can broadcast using the Application context, Whatever action of Intent you set here that you have to define in the AndroidManifest.xml with the receiver tag.