公共和私人意图有什么区别(what is difference between public and private Intents)

编程入门 行业动态 更新时间:2024-10-25 15:23:35
公共和私人意图有什么区别(what is difference between public and private Intents)

我知道在系统中注册的公共(命名)意图可以从单个应用程序中使用的任何应用程序和私有(匿名)意图中调用。 请有人给我一个例子,以便更好地理解。

提前致谢

I know that public (named) intents that are registered with the system and can be called from any application and private (anonymous) intents that are used within a single application. please can anyone give me an example for better understanding.

Thanks in advance

最满意答案

抱歉没时间写完整的答案,但您可以创建自定义权限以便签署您的Intents和BroadcastReceivers 。

使用这些自定义权限时,只有使用相同签名密钥签名并包含该自定义权限的应用才能看到这些意图。

这个问题可能对您有所帮助

如何在Android中使用自定义权限?

@Commonsware在最近的博客文章中解释了这个问题:

没有意外API - CommonsBlog

Sorry no time to write a full answer, but you can create custom permissions in order to sign your Intents & BroadcastReceivers.

When you use these custom permissions, only apps that have been signed with the same signing key, and include that custom permission, can see these Intents.

This question might help you:

How to use custom permissions in Android?

@Commonsware explains the issue really well in a recent blog post:

Don't have an Accidental API - The CommonsBlog

更多推荐

本文发布于:2023-08-06 15:53:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1451162.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:有什么区别   意图   私人   difference   private

发布评论

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

>www.elefans.com

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