2025 年 4 月 1 日,Library API 中的部分範圍已遭到移除。
詳情請參閱這篇文章。
相片挑選:使用者看到的內容
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
本指南可協助您瞭解使用者選取媒體項目時的體驗。
按照標準 Picker API 流程,應用程式顯示 pickerUri
後,系統就會開始挑選,而應用程式會輪詢 mediaItemsSet
是否傳回 true。
如要在自己的裝置上查看這些步驟,請參閱我們的範例應用程式。
開始挑選工作階段
成功建立工作階段後,應用程式應向使用者顯示 pickerUri
。
- 以 QR code 和網址的形式顯示
pickerUri
。
- 在
pickerUri
旁邊提供實用文字。例如:「掃描這個代碼即可開啟 Google 相簿並選取項目」。
- 如果裝置的輸入功能有限 (例如資訊亭、平板電腦、智慧型電視),請參閱硬體製造商的建議,瞭解文字大小和 QR code 寬度。
搜尋並選取相片
使用者存取 pickerUri
時,系統會將他們帶往 Google 相簿應用程式內的相片選取頁面。
這個頁面一律會顯示使用者 Google 相簿資料庫中的最新相片。系統不會直接顯示相簿、我的最愛和其他常見的相片類別。使用者可以根據各種條件搜尋相片,例如關鍵字、日期、地點和相簿名稱。
如果應用程式會使用相簿、日期或其他常見的相片類別,請在使用者進入 Google 相簿應用程式時,提示他們進行搜尋,方便他們找到所需內容。
舉例來說,如果要求使用者分享特定相簿,您可以在使用者連結至 Google 相簿的同一頁面中加入下列文字:「連結至 Google 相簿,然後搜尋要分享的相簿。」
搜尋後,使用者可以從結果中選取一或多個項目。
完成畫面
使用者輕觸「完成」按鈕並完成挑選後,就會看到「完成」畫面。這會結束揀貨作業,目前的 pickerUri
將無法再使用。
如要讓使用者選取更多相片,請建立新的選取作業,並在應用程式中再次顯示 pickerUri
。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-09-18 (世界標準時間)。
[[["容易理解","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-09-18 (世界標準時間)。"],[[["\u003cp\u003eThis guide explains the user experience within the Google Photos app when selecting media items using the Picker API.\u003c/p\u003e\n"],["\u003cp\u003eUsers initiate the process by accessing the \u003ccode\u003epickerUri\u003c/code\u003e displayed in your app, which opens a photo selection page within Google Photos.\u003c/p\u003e\n"],["\u003cp\u003eUsers can search and select photos from their Google Photos library using various criteria before confirming their choices.\u003c/p\u003e\n"],["\u003cp\u003eAfter selection, users are presented with a "Done" screen, and your app can re-display the \u003ccode\u003epickerUri\u003c/code\u003e to allow for further selections in a new session.\u003c/p\u003e\n"]]],["The core process involves displaying a `pickerUri` (QR code and URL) to users, prompting them to access it. This takes them to Google Photos for photo selection. Users can search using keywords, dates, or locations to find specific photos. Upon selection and pressing \"Done,\" the process ends. Apps can offer to display the `pickerUri` again to initiate a new picking session, to select more items. While the app is polling for the media selection the process has begun.\n"],null,[]]