How to determine the broadcast sender

I have an application that is both a broadcast sender and a receiver of the standard action android.intent.action.SET_WALLPAPER. I want to do some things only when another application broadcast this intention.

Is it possible to determine who initiated the broadcast in the onReceive method for BroadcastReceiver?

+5
source share
2 answers

No.

If you only want to do something when the action was transferred by another application (i.e. not yours), I believe that it should be easy for you to determine that your application did not send this broadcast, and therefore it was someone else .

+4

, , , , . :

broadcastIntent.putExtra('com.android.app.EXTRA_APP_CREATED', true)

, ,

if (intent.getExtra('com.android.app.EXTRA_APP_CREATED', false) { ... }

, .

+5

All Articles