分享简单的数据
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
Android 应用的一大优点是能够相互通信和集成。既然功能已经存在于另一个应用中,为什么还要重新开发那些不属于应用核心的功能?
本部分介绍如何使用 Android Sharesheet 和 Intent Resolver 及 Intent
对象在应用之间发送和接收简单数据(如文本、图片和文件)的一些常用方法。
课程
- 将简单数据发送到其他应用
- 了解如何设置您的应用,以使用 Android Sharesheet 和 intent 解析器向其他应用发送文本和其他数据。
- 从其他应用接收简单数据
- 了解如何设置应用,以从 intent 接收文本和其他数据。
注意:强烈建议您不要使用 ActionProvider
在应用中显示共享操作。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-27。
[null,null,["最后更新时间 (UTC):2025-07-27。"],[],[],null,["# Sharing simple data\n\nOne of the great things about Android apps is their ability to communicate and\nintegrate with each other. Why reinvent functionality that isn't core to your application when it\nalready exists in another application?\n\nThis section covers some common ways you can send and receive simple data (like text, images and files) between\napplications using the Android Sharesheet and Intent Resolver with\n[Intent](/reference/android/content/Intent) objects.\n\nLessons\n-------\n\n**[Sending Simple Data to Other Apps](/training/sharing/send)**\n: Learn how to set up your application to be able to send text and other data to other\n applications with the Android Sharesheet and intent resolver.\n\n**[Receiving Simple Data from Other Apps](/training/sharing/receive)**\n: Learn how to set up your application to receive text and other data from intents.\n\nNote: use of [ActionProvider](/reference/android/view/ActionProvider)\nto show share actions within your application is highly discouraged."]]