Joke Collection Website - Blessing messages - When android accepts the broadcast, how do you determine which application sent the broadcast?

When android accepts the broadcast, how do you determine which application sent the broadcast?

View the interface that receives the broadcast:

Public abstract void onReceive (Context, intention);

There is a parameter context here, which is the context of the application that sends the broadcast, and the general application sends the broadcast in a way similar to the following:

Context context = MyActivity.this

Context.sendBroadcast (intention);

The context in the received broadcast is the context when it was sent here. By printing the context in onReceive, you can clearly know which application sent the broadcast:

Public void on Receive {

Log.w (tag, "context =“+context););

//。 . . . . .

}