如何排除从分享菜单中选择您自己的应用程序? [英] How to exclude your own app from the Share menu?

查看:198
本文介绍了如何排除从分享菜单中选择您自己的应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

该应用程序有一个意图过滤器,使其能够出现在经ACTION_SEND意图其它应用程序共享菜单。该应用程序本身也有使用ACTION_SEND和createChooser()A股菜单,和我的应用程序出现在列表中。因为他们已经在我的应用程序,我觉得奇怪,让他们能够分享到它自身。

有没有办法为我的应用程序不会出现在列表中,如果它正从我的应用程序叫什么名字?

解决方案
  

有没有办法为我的应用程序不会出现在列表中,如果它正从我的应用程序叫什么名字?

而不是通过 createChooser()。您可以创建通过 PackageManager 你自己选择器般的对话和 queryIntentActivities()和筛选自己出这样一来,虽然。

The app has an intent filter to allow it to appear in the share menu in other applications via ACTION_SEND intents. The app itself also has a share menu using ACTION_SEND and createChooser(), and my app appears in the list. Since they are already in my app it seems strange to have them be able to share back to itself.

Is there a way for my app not to appear in the list if it's being called from my app?

解决方案

Is there a way for my app not to appear in the list if it's being called from my app?

Not via createChooser(). You can create your own chooser-like dialog via PackageManager and queryIntentActivities() and filter yourself out that way, though.

这篇关于如何排除从分享菜单中选择您自己的应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆