我有一个应用程序,它是在同一时间广播发送者和标准动作android.intent.action.SET_WALLPAPER接收器。我想做一些东西,只有在一个情况下,当其他应用程序播放此意图。
I have an application that is at the same time a broadcast sender and receiver of standard action android.intent.action.SET_WALLPAPER. I want to do some stuff only in a case when another application broadcasted this intent.
有什么方法来决定谁在一个BroadcastReceiver中的onReceive方法启动的广播?
Is there any way to determine who initiated a broadcast in onReceive method of a BroadcastReceiver?
推荐答案没有。
如果你只想做一些事情,当一个动作被另一个应用程序的广播(即不是你),我想这应该很容易判断您的应用程序的没有的发送该广播,并因此,它是别人。
If you only want to do something when an action was broadcast by another app (i.e. not yours), I imagine it should be easy to determine that your app didn't send this broadcast, and therefore it was someone else..
更多推荐
如何确定播出意向的发送者
发布评论