仅限特定应用程序进行操作.发送

发布于 2024-10-18 01:04:00 字数 305 浏览 4 评论 0原文

我想从我的应用程序发送链接。我使用以下代码:

intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_SUBJECT, subject);
intent.putExtra(Intent.EXTRA_TEXT, text);
startActivity(Intent.createChooser(intent, "Share"));

这会弹出一个包含某些应用程序的对话框。但现在我想过滤这个列表,即我想删除蓝牙应用程序。

如何从此对话框中删除应用程序?

i want to send link from my app. I use the following code:

intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_SUBJECT, subject);
intent.putExtra(Intent.EXTRA_TEXT, text);
startActivity(Intent.createChooser(intent, "Share"));

This brings up a dialog with some Apps. But now I would like to filter this list, i.e. I would like to remove the Blutooth app.

How can i remove apps from this dialog?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

生生漫 2024-10-25 01:04:00

您无法直接“从此对话框中删除应用程序”。

欢迎您使用 PackageManagerqueryIntentActivities() 并呈现您自己的自定义对话框。但是,您将无法可靠地识别“蓝牙应用程序”,因为在给定设备上可能有任何符合条件的东西,根据设备制造商的不同,它可能有不同的名称。

You cannot "remove apps from this dialog" directly.

You are welcome to use PackageManager and queryIntentActivities() and present your own custom dialog of stuff. However, you will not be able to reliably identify "the Bluetooth app", since extent there is anything that might qualify on a given device, it may have different names based upon device manufacturer.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文