分享應用程式畫面
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
Android 媒體投影功能可讓使用者與他人分享裝置畫面。在 Android 14 QPR2 中,使用者可以分享或錄製應用程式視窗,而非整個裝置畫面。
應用程式畫面分享功能可讓使用者執行多個應用程式,但限制內容只能分享至單一應用程式,因此能提高隱私權、提升使用者工作效率,並強化多工處理能力。
分享應用程式畫面時,系統不會顯示狀態列、導覽列、通知和其他系統 UI 元素。系統只會分享所選應用程式的內容。
使用 MediaProjection
API 的應用程式可自動分享應用程式畫面。不過,請測試應用程式,確保應用程式分享螢幕畫面功能正常運作。
Android 14 (API 級別 34) 新增下列媒體投影回呼方法,可供您自訂應用程式畫面分享功能:
使用新方法提升應用程式畫面分享功能的使用者體驗。
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-08-21 (世界標準時間)。
[[["容易理解","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-08-21 (世界標準時間)。"],[],[],null,["# App screen sharing\n\nMedia projection on Android enables users to share their device display with other users. On Android 14 QPR2, users can share or record an app window rather than the entire device screen.\n\nApp screen sharing increases privacy, improves user productivity, and enhances multitasking by enabling users to run multiple apps but restrict content sharing to a single app.\n\nWith app screen sharing, the status bar, navigation bar, notifications, and other system UI elements are excluded from the shared display. Only the content of the selected app is shared.\n\nApps that use the [`MediaProjection`](/reference/kotlin/android/media/projection/MediaProjection) APIs are capable of app screen sharing automatically. However, test your app to ensure app screen sharing works as intended.\n\n### `MediaProjection` callbacks\n\nAndroid 14 (API level 34) added the following media projection callback methods which enable you to customize app screen sharing:\n\n- [**`MediaProjection.Callback#onCapturedContentResize()`**](/reference/kotlin/android/media/projection/MediaProjection.Callback#oncapturedcontentresize)\n\n Enables resizing of the shared projection based on the size of the captured display area.\n- [**`MediaProjection.Callback#onCapturedContentVisibilityChanged()`**](/reference/kotlin/android/media/projection/MediaProjection.Callback#oncapturedcontentvisibilitychanged)\n\n Informs the shared projection host app of the visibility of the capture content. The host app can show or hide the captured content on the output surface based on whether the captured region is visible to the user. For example, in multi‑window mode, if another app completely covers the shared app, the host can hide the shared app on the output surface.\n\nUse the new methods to enhance the app screen sharing user experience."]]