如何确定播出意向的发送者

编程入门 行业动态 更新时间:2024-10-11 13:19:38
本文介绍了如何确定播出意向的发送者的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个应用程序,它是在同一时间广播发送者和标准动作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..

更多推荐

如何确定播出意向的发送者

本文发布于:2023-11-25 20:15:13,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1631196.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:意向

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!