使用共享按钮(如 ICS 库中)而不是共享对话框 (Intent.ACTION_SEND)
我正在尝试找到一种方法在我的应用程序中实现共享按钮(与标准 ICS 图库应用程序中的按钮相同,请参阅图片链接)。 http://betanews.com/2011/10/19/get-acquainted-with-the-newest-android-ice-cream-sandwich-slideshow/#11
Intent.ACTION_SEND 仅打开一个对话框选择共享选项。 Android Share Via Dialog
这工作正常,但从设计方面来看,我发现这个下拉列表选择应用程序更方便。 但我不知道该怎么做? 有人知道如何对这个按钮进行编码吗?
I am trying to find a way to impelement a share button into my app (same like the one in the standard ICS gallary app, see picture link).
http://betanews.com/2011/10/19/get-acquainted-with-the-newest-android-ice-cream-sandwich-slideshow/#11
Intent.ACTION_SEND only opens a dialoge to the select the sharing options.
Android Share Via Dialog
This works fine, but from design side, I find this drop down list to select a app much more convenient.
Yet I cant figure out how to?
Does anybody have a good Idea how this button could be coded?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是使用
ListPopupWindow
实现的,目前仅在 Android 4.0 上可用。That is implemented using a
ListPopupWindow
, which at the moment is only available on Android 4.0.这是使用 SDK14+ 中提供的 ShareActionProvider 实现的。
它很容易实现,您可以按照官方文档
This is implemented using ShareActionProvider available in SDK14+.
Its quiet easy to implement, you can follow the official documentation here.