透過集合功能整理內容
你可以依據偏好儲存及分類內容。
privacysandbox activity
TODO
最近更新時間 |
穩定版 |
候選版 |
Beta 版 |
Alpha 版 |
2025 年 3 月 26 日 |
- |
- |
- |
1.0.0-alpha02 |
宣告依附元件
如要新增 privacysandbox-activity 的依附元件,您必須將 Google Maven 存放區新增至專案。詳情請參閱 Google 的 Maven 存放區。
在應用程式或模組的 build.gradle
檔案中,新增所需構件的依附元件:
Groovy
dependencies {
// Use to implement privacysandbox activitys
// TODO: Confirm these dependencies
implementation "androidx.privacysandbox.activity:activity:1.0.0-alpha02"
// Use to implement privacysandbox activity complications
// TODO: Confirm these dependencies
implementation "androidx.privacysandbox.activity:activity-complications-data-source:1.0.0-alpha02"
// (Kotlin-specific extensions)
// TODO: Confirm these dependencies
implementation "androidx.privacysandbox.activity:activity-complications-data-source-ktx:1.0.0-alpha02"
// Use to implement a activity style and complication editor
// TODO: Confirm these dependencies
implementation "androidx.privacysandbox.activity:activity-editor:1.0.0-alpha02"
// Can use to render complications.
// TODO: Confirm these dependencies
// This library is optional and activitys may have custom implementation for rendering
// complications.
// TODO: Confirm these dependencies
implementation "androidx.privacysandbox.activity:activity-complications-rendering:1.0.0-alpha02"
}
Kotlin
dependencies {
// Use to implement privacysandbox activitys
// TODO: Confirm these dependencies
implementation("androidx.privacysandbox.activity:activity:1.0.0-alpha02")
// Use to implement privacysandbox activity complications
// TODO: Confirm these dependencies
implementation "androidx.privacysandbox.activity:activity-complications-data-source:1.0.0-alpha02"
// (Kotlin-specific extensions)
// TODO: Confirm these dependencies
implementation "androidx.privacysandbox.activity:activity-complications-data-source-ktx:1.0.0-alpha02"
// Use to implement a activity style and complication editor
// TODO: Confirm these dependencies
implementation("androidx.privacysandbox.activity:activity-editor:1.0.0-alpha02")
// Can use to render complications.
// TODO: Confirm these dependencies
// This library is optional and activitys may have custom implementation for rendering
// complications.
// TODO: Confirm these dependencies
implementation "androidx.privacysandbox.activity:activity-complications-rendering:1.0.0-alpha02"
}
如要進一步瞭解依附元件,請參閱「新增建構依附元件」一文。
意見回饋
您的意見可協助我們改善 Jetpack。如果您發現新問題,或是有改進這個程式庫的建議,請告訴我們。回報新問題前,請先查看這個程式庫的現有問題。只要按一下星號按鈕,即可投票給現有的問題。
建立新問題
詳情請參閱 Issue Tracker 說明文件。
1.0 版本
1.0.0-alpha02 版
2025 年 3 月 26 日
發布 androidx.privacysandbox.activity:activity-client:1.0.0-alpha02
、androidx.privacysandbox.activity:activity-core:1.0.0-alpha02
和 androidx.privacysandbox.activity:activity-provider:1.0.0-alpha02
。1.0.0-alpha02 版包含這些修訂項目。
新功能
- 您現在可以為生命週期不感知的活動 (也就是未實作
LifecycleOwner
介面的活動) 建立 SDK 活動啟動器。呼叫端必須手動處置這些啟動器。
API 變更
- 新增
LocalUnmanagedSdkActivityLauncher
和 createUnmanagedSdkActivityLauncher
,這是生命週期不相容活動的啟動器類別,以及建立此類啟動器的方法。
- 將
LocalSdkActivityLauncher
重新命名為 LocalManagedSdkActivityLauncher
,以凸顯此類型與生命週期不相容的啟動器之間的差異。
1.0.0-alpha01 版
2023 年 11 月 15 日
發布 androidx.privacysandbox.activity:activity-client:1.0.0-alpha01
、androidx.privacysandbox.activity:activity-core:1.0.0-alpha01
和 androidx.privacysandbox.activity:activity-provider:1.0.0-alpha01
。1.0.0-alpha01 版本包含這些修訂版本。
新功能
- 推出專屬的 Privacy Sandbox Activity 程式庫。
- 其中包含從 SDK 執行階段啟動活動的介面。這些介面先前已在 Privacy Sandbox UI 程式庫中定義。
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。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,["# privacysandbox activity\n=======================\n\nAPI Reference \n[androidx.privacysandbox.activity](/reference/kotlin/androidx/privacysandbox/activity/package-summary) \nTODO \n\n| Latest Update | Stable Release | Release Candidate | Beta Release | Alpha Release |\n|----------------|----------------|-------------------|--------------|-----------------------------------------------------------------------------------|\n| March 26, 2025 | - | - | - | [1.0.0-alpha02](/jetpack/androidx/releases/privacysandbox-activity#1.0.0-alpha02) |\n\nDeclaring dependencies\n----------------------\n\nTo add a dependency on privacysandbox-activity, you must add the Google Maven repository to your\nproject. Read [Google's Maven repository](/studio/build/dependencies#google-maven)\nfor more information.\n\nAdd the dependencies for the artifacts you need in the `build.gradle` file for\nyour app or module: \n\n### Groovy\n\n```groovy\ndependencies {\n // Use to implement privacysandbox activitys\n // TODO: Confirm these dependencies\n implementation \"androidx.privacysandbox.activity:activity:1.0.0-alpha02\"\n\n // Use to implement privacysandbox activity complications\n // TODO: Confirm these dependencies\n implementation \"androidx.privacysandbox.activity:activity-complications-data-source:1.0.0-alpha02\"\n // (Kotlin-specific extensions)\n // TODO: Confirm these dependencies\n implementation \"androidx.privacysandbox.activity:activity-complications-data-source-ktx:1.0.0-alpha02\"\n\n // Use to implement a activity style and complication editor\n // TODO: Confirm these dependencies\n implementation \"androidx.privacysandbox.activity:activity-editor:1.0.0-alpha02\"\n\n // Can use to render complications.\n // TODO: Confirm these dependencies\n // This library is optional and activitys may have custom implementation for rendering\n // complications.\n // TODO: Confirm these dependencies\n implementation \"androidx.privacysandbox.activity:activity-complications-rendering:1.0.0-alpha02\"\n}\n```\n\n### Kotlin\n\n```kotlin\ndependencies {\n // Use to implement privacysandbox activitys\n // TODO: Confirm these dependencies\n implementation(\"androidx.privacysandbox.activity:activity:1.0.0-alpha02\")\n\n // Use to implement privacysandbox activity complications\n // TODO: Confirm these dependencies\n implementation \"androidx.privacysandbox.activity:activity-complications-data-source:1.0.0-alpha02\"\n // (Kotlin-specific extensions)\n // TODO: Confirm these dependencies\n implementation \"androidx.privacysandbox.activity:activity-complications-data-source-ktx:1.0.0-alpha02\"\n\n // Use to implement a activity style and complication editor\n // TODO: Confirm these dependencies\n implementation(\"androidx.privacysandbox.activity:activity-editor:1.0.0-alpha02\")\n\n // Can use to render complications.\n // TODO: Confirm these dependencies\n // This library is optional and activitys may have custom implementation for rendering\n // complications.\n // TODO: Confirm these dependencies\n implementation \"androidx.privacysandbox.activity:activity-complications-rendering:1.0.0-alpha02\"\n}\n```\n\nFor more information about dependencies, see [Add build dependencies](/studio/build/dependencies).\n\nFeedback\n--------\n\nYour feedback helps make Jetpack better. Let us know if you discover new issues or have\nideas for improving this library. Please take a look at the\n[existing issues](https://issuetracker.google.com/issues?q=componentid:1116743%20status:open)\nin this library before you create a new one. You can add your vote to an existing issue by\nclicking the star button.\n\n[Create a new issue](https://issuetracker.google.com/issues/new?component=1116743&template=1629474)\n\nSee the [Issue Tracker documentation](https://developers.google.com/issue-tracker)\nfor more information.\n\nVersion 1.0\n-----------\n\n### Version 1.0.0-alpha02\n\nMarch 26, 2025\n\n`androidx.privacysandbox.activity:activity-client:1.0.0-alpha02`, `androidx.privacysandbox.activity:activity-core:1.0.0-alpha02`, and `androidx.privacysandbox.activity:activity-provider:1.0.0-alpha02` are released. Version 1.0.0-alpha02 contains [these commits](https://android.googlesource.com/platform/frameworks/support/+log/312eb9f1ddece3a18317f18515a877e0e745cb2c..78132378b67c86698d1ade3dc368c9f15d738a71/privacysandbox/activity).\n\n**New Features**\n\n- SDK activity launchers can now be created for lifecycle-unaware activities, i.e. activities that don't implement the `LifecycleOwner` interface. These launchers need to be manually disposed of by the caller.\n\n**API Changes**\n\n- Added `LocalUnmanagedSdkActivityLauncher` and `createUnmanagedSdkActivityLauncher`, a launcher class for lifecycle-unaware activities and a method to create such launchers.\n- Renamed `LocalSdkActivityLauncher` to `LocalManagedSdkActivityLauncher` to highlight the distinction between this and lifecycle-unaware type of launchers.\n\n### Version 1.0.0-alpha01\n\nNovember 15, 2023\n\n`androidx.privacysandbox.activity:activity-client:1.0.0-alpha01`, `androidx.privacysandbox.activity:activity-core:1.0.0-alpha01`, and `androidx.privacysandbox.activity:activity-provider:1.0.0-alpha01` are released. [Version 1.0.0-alpha01 contains these commits.](https://android.googlesource.com/platform/frameworks/support/+log/312eb9f1ddece3a18317f18515a877e0e745cb2c/privacysandbox/activity)\n\n**New Features**\n\n- Introducing a dedicated Privacy Sandbox Activity library.\n- It contains interfaces for launching activities from the SDK Runtime. The interfaces were previously defined in the Privacy Sandbox UI library."]]