仅限特定应用程序进行操作.发送
我想从我的应用程序发送链接。我使用以下代码:
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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您无法直接“从此对话框中删除应用程序”。
欢迎您使用
PackageManager
和queryIntentActivities()
并呈现您自己的自定义对话框。但是,您将无法可靠地识别“蓝牙应用程序”,因为在给定设备上可能有任何符合条件的东西,根据设备制造商的不同,它可能有不同的名称。You cannot "remove apps from this dialog" directly.
You are welcome to use
PackageManager
andqueryIntentActivities()
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.