分享簡單資料
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
Android 應用程式的優點之一,就是能夠互相通訊及整合。為何當應用程式已存在於其他應用程式時,為何要重塑非核心的功能?
本節說明使用 Android Sharesheet 和 Intent
物件的 Intent Resolver,在應用程式之間傳送及接收簡單資料 (例如文字、圖片和檔案) 的一些常見方式。
課程
- 傳送簡單資料至其他應用程式
- 瞭解如何設定應用程式,以便使用 Android Sharesheet 和意圖解析器,將文字和其他資料傳送至其他應用程式。
- 接收其他應用程式傳送的簡單資料
- 瞭解如何設定應用程式,以便接收來自意圖的文字和其他資料。
注意:我們不建議使用 ActionProvider
在應用程式中顯示共用動作。
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-07-27 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間: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."]]