透過集合功能整理內容
你可以依據偏好儲存及分類內容。
Versionedparcelable
提供穩定且精簡的二進位序列化格式,可在程序之間傳遞,或是以安全的方式保留。
最近更新時間 |
穩定版 |
候選版 |
Beta 版 |
Alpha 版 |
2025 年 1 月 29 日 |
1.2.1 |
- |
- |
- |
意見回饋
您的意見可協助我們改善 Jetpack。如果您發現新問題,或是有改進這個程式庫的建議,請告訴我們。回報新問題前,請先查看這個程式庫的現有問題。只要按一下星號按鈕,即可投票給現有的問題。
建立新問題
詳情請參閱 Issue Tracker 說明文件。
1.2 版本
1.2.1 版本
2025 年 1 月 29 日
發布 androidx.versionedparcelable:versionedparcelable:1.2.1
。1.2.1 版包含這些修訂項目。
修正錯誤
- 更新
VersionedParcelable
,避免在解包的初始階段執行類別初始化作業,以免外部控制的輸入內容在應用程式路徑集區中執行非 VersionedParcelable
類別的靜態初始化區塊中執行非預期的程式碼。(Icceed)
- 這個程式庫現在使用 JSpecify 空值註解,這是類型用途。Kotlin 開發人員應使用下列編譯器引數,確保正確使用方式:
-Xjspecify-annotations=strict
(這是 Kotlin 編譯器 2.1.0 版起的預設值)。(Ibc328、b/326456246)。
- 移除新平台 API 存取權的手動設定,因為在使用 AGP 7.3 以上版本 (例如 R8 3.3 版) 的 R8 時,以及在使用 AGP 8.1 以上版本 (例如 D8 8.1 版) 的所有版本時,系統會透過 API 模擬功能自動執行此操作。建議未使用 AGP 的用戶端更新至 D8 8.1 以上版本。詳情請參閱這篇文章。(Ia60e0、b/345472586)
1.2.0 版本
2024 年 1 月 10 日
發布 androidx.versionedparcelable:versionedparcelable:1.2.0
。1.2.0 版包含此連結所列的修訂項目。
自 1.1.0 版以來的重要異動
- 新增對使用 Stable AIDL 的專案依附
VersionedParcelable
的支援。
1.2.0-rc01 版本
2023 年 12 月 13 日
發布 androidx.versionedparcelable:versionedparcelable:1.2.0-rc01
。與上一個 Beta 版相比沒有任何異動。
1.2.0-beta01 版本
2023 年 11 月 29 日
發布 androidx.versionedparcelable:versionedparcelable:1.2.0-beta01
,且自 1.2.0-alpha01 版以來皆無異動。查看 1.2.0-beta01 版的修訂項。
1.2.0-alpha01 版本
2023 年 11 月 15 日
發布 androidx.versionedparcelable:versionedparcelable:1.2.0-alpha01
。1.2.0-alpha01 版包含此連結所列的修訂項目。
新功能
API 變更
1.1.1 版
1.1.1 版
2020 年 4 月 15 日
發布 androidx.versionedparcelable:versionedparcelable:1.1.1
。1.1.1 版包含此連結所列的修訂項目。
修正錯誤
- 更新 ProGuard 規則,保留所有實作
VersionedParcelable
的類別,包括非公開類別 (I480bf8)
1.1.0 版本
1.1.0 版本
2019 年 8 月 7 日
發布 androidx.versionedparcelable:versionedparcelable:1.1.0
。您可以前往這裡查看這個版本包含的修訂項目。
以下摘要說明1.0.0
到 1.1.0
的異動:
新功能
- 全新便利方法
ParcelUtils.getVersionedParcelableList()
和 ParcelUtils.putVersionedParcelableList()
API 變更
- 如果套件中找不到金鑰,
ParcelUtils.getVersionedParcelable()
現在會傳回空值
ParcelUtils.putVersionedParcelable()
現在可接受空值的 VersionedParcelable 物件
1.1.0-rc01 版本
2019 年 6 月 5 日
發布 androidx.versionedparcelable:versionedparcelable:1.1.0-rc01
,且自 1.1.0-beta01 以來皆無異動。您可以前往這裡查看這個版本包含的修訂項目。
1.1.0-beta01 版本
2019 年 5 月 7 日
發布了 androidx.versionedparcelable:versionedparcelable:1.1.0-alpha01
。您可以前往這裡查看這個版本包含的修訂項目。
API 變更
Parcelutils.getVersionedParcelable
和 Parcelutils.putVersionedParcelable` 現已支援空值 (aosp/940072)
RemoteActionCompat
現在是 VersionedParcelable` (aosp/928534)
1.1.0-alpha02 版本
2019 年 3 月 13 日
發布了 androidx.versionedparcelable:versionedparcelable:1.1.0-alpha02
。您可以前往這裡查看這個版本包含的修訂項目完整清單。
修正錯誤
1.1.0-alpha01 版本
2018 年 11 月 5 日
新功能
- 在除了 VersionedParcelStream 之外的所有類別中新增了對 CharSequence 的支援。
- 新增 SuperClass、Set 和 Map 支援功能。
修正錯誤
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。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,["# Versionedparcelable\n===================\n\nAPI Reference \n[androidx.versionedparcelable](/reference/kotlin/androidx/versionedparcelable/package-summary) \nProvides a stable and compact binary serialization format that can be passed across processes or persisted safely. \n\n| Latest Update | Stable Release | Release Candidate | Beta Release | Alpha Release |\n|------------------|---------------------------------------------------------------|-------------------|--------------|---------------|\n| January 29, 2025 | [1.2.1](/jetpack/androidx/releases/versionedparcelable#1.2.1) | - | - | - |\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:460991%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=460991&template=1422652)\n\nSee the [Issue Tracker documentation](https://developers.google.com/issue-tracker)\nfor more information.\n\nVersion 1.2\n-----------\n\n### Version 1.2.1\n\nJanuary 29, 2025\n\n`androidx.versionedparcelable:versionedparcelable:1.2.1` is released. Version 1.2.1 contains [these commits](https://android.googlesource.com/platform/frameworks/support/+log/5fad42d44b65dfac68191ccd49e22d418b82c625..bed62b26ea4f47707c9610421bfed533c6830c58/versionedparcelable/versionedparcelable).\n\n**Bug Fixes**\n\n- Updated `VersionedParcelable` to avoid class init during the initial stages of unparceling, which prevents externally-controlled inputs from executing unexpected code in static initialization blocks for non-`VersionedParcelable` classes already present in the application classpath. ([Icceed](https://android-review.googlesource.com/#/q/Icceed9dfc7c78434d78336f2f606fc0530133d7c))\n- This library now uses [JSpecify nullness annotations](https://jspecify.dev/), which are type-use. Kotlin developers should use the following compiler argument to enforce correct usage: `-Xjspecify-annotations=strict` (this is the default starting with version 2.1.0 of the Kotlin compiler). ([Ibc328](https://android-review.googlesource.com/#/q/Ibc3284a4b99a39636c4ec08e448ffbe434473e77), [b/326456246](https://issuetracker.google.com/issues/326456246))\n- Removed manual outlining of access to new platform APIs since this happens automatically via API modeling when using R8 with AGP 7.3 or later (e.g. R8 version 3.3) and for all builds when using AGP 8.1 or later (e.g. D8 version 8.1). Clients who are not using AGP are advised to update to D8 version 8.1 or later. See [this article](https://medium.com/androiddevelopers/mitigating-soft-verification-issues-in-r8-and-d8-7e9e06827dfd) for more details. ([Ia60e0](https://android-review.googlesource.com/#/q/Ia60e0ab9f0fd613883a772c8aa34e27cc986cae8), [b/345472586](https://issuetracker.google.com/issues/345472586))\n\n### Version 1.2.0\n\nJanuary 10, 2024\n\n`androidx.versionedparcelable:versionedparcelable:1.2.0` is released. [Version 1.2.0 contains these commits.](https://android.googlesource.com/platform/frameworks/support/+log/d24bc8cd7ea22574c46ea04d0ca524299c35be53..5fad42d44b65dfac68191ccd49e22d418b82c625/versionedparcelable/versionedparcelable)\n\n**Important changes since 1.1.0**\n\n- Added support for depending on `VersionedParcelable` from a project using Stable AIDL.\n\n### Version 1.2.0-rc01\n\nDecember 13, 2023\n\n`androidx.versionedparcelable:versionedparcelable:1.2.0-rc01` is released. There are no changes since the previous beta release.\n\n### Version 1.2.0-beta01\n\nNovember 29, 2023\n\n`androidx.versionedparcelable:versionedparcelable:1.2.0-beta01` is released with no changes since 1.2.0-alpha01. [Version 1.2.0-beta01 contains these commits.](https://android.googlesource.com/platform/frameworks/support/+log/312eb9f1ddece3a18317f18515a877e0e745cb2c..b5166f9a1e9c047162d1215884c3e2cd41a4a74a/versionedparcelable/versionedparcelable)\n\n### Version 1.2.0-alpha01\n\nNovember 15, 2023\n\n`androidx.versionedparcelable:versionedparcelable:1.2.0-alpha01` is released. [Version 1.2.0-alpha01 contains these commits.](https://android.googlesource.com/platform/frameworks/support/+log/9fd278801e06c07a5d230fd7edbb97e16c322949..312eb9f1ddece3a18317f18515a877e0e745cb2c/versionedparcelable/versionedparcelable)\n\n**New Features**\n\n- Export stable AIDL definitions to dependent projects ([I473cb](https://android-review.googlesource.com/#/q/I473cbc23b15505b8493a00766248fcd1d8a10a96), [b/277084531](https://issuetracker.google.com/issues/277084531))\n\n**API Changes**\n\n- Added nullability annotations ([Ic16ed](https://android-review.googlesource.com/#/q/Ic16ed43e46dfd51803d40e6332b0cf34467aaf7c))\n\nVersion 1.1.1\n-------------\n\n### Version 1.1.1\n\nApril 15, 2020\n\n`androidx.versionedparcelable:versionedparcelable:1.1.1` is released. [Version 1.1.1 contains these commits.](https://android.googlesource.com/platform/frameworks/support/+log/e9fe1bb5aab6c2f410f8992bfe340768e0c74abd..9fd278801e06c07a5d230fd7edbb97e16c322949/versionedparcelable)\n\n**Bug Fixes**\n\n- Updated ProGuard rules to keep all classes that implement `VersionedParcelable`, including non-public classes ([I480bf8](https://android-review.googlesource.com/q/I480bf84ca20b79f83ea4d6c74af45ea55a3b8e9a))\n\nVersion 1.1.0\n-------------\n\n### Version 1.1.0\n\nAugust 7, 2019\n\n`androidx.versionedparcelable:versionedparcelable:1.1.0` is released. The commits included in this version can be found [here](https://android.googlesource.com/platform/frameworks/support/+log/33004feca088677f6f8135824d6e09169afd3491..e9fe1bb5aab6c2f410f8992bfe340768e0c74abd/versionedparcelable).\n\n**Below is a summary of changes from `1.0.0` to `1.1.0`:**\n\n**New features**\n\n- New convenience methods `ParcelUtils.getVersionedParcelableList()` and `ParcelUtils.putVersionedParcelableList()`\n\n**API changes**\n\n- `ParcelUtils.getVersionedParcelable()` now returns null if the key is not found in the bundle\n- `ParcelUtils.putVersionedParcelable()` now accepts null VersionedParcelable objects\n\n### Version 1.1.0-rc01\n\nJune 5, 2019\n\n`androidx.versionedparcelable:versionedparcelable:1.1.0-rc01` is released with no changes from 1.1.0-beta01. The commits included in this version can be found [here](https://android.googlesource.com/platform/frameworks/support/+log/fbdc0c35696b2e1ee3216e3e8c397aeb1abe4311..33004feca088677f6f8135824d6e09169afd3491/versionedparcelable).\n\n### Version 1.1.0-beta01\n\nMay 7, 2019\n\n`androidx.versionedparcelable:versionedparcelable:1.1.0-alpha01` is released. The commits included in this version can be found [here](https://android.googlesource.com/platform/frameworks/support/+log/0b2c8b5a3ea18e80b32b57c49dba74c2812946ee..fbdc0c35696b2e1ee3216e3e8c397aeb1abe4311/versionedparcelable).\n\n**API changes**\n\n- `Parcelutils.getVersionedParcelable` and Parcelutils.putVersionedParcelable\\` now support null ([aosp/940072](https://android-review.googlesource.com/c/940072/))\n- `RemoteActionCompat` is now a VersionedParcelable\\` ([aosp/928534](https://android-review.googlesource.com/c/928534/))\n\n### Version 1.1.0-alpha02\n\nMarch 13, 2019\n\n`androidx.versionedparcelable:versionedparcelable:1.1.0-alpha02` is released. The full list of commits included in this version can be found [here](https://android.googlesource.com/platform/frameworks/support/+log/f1c97d6550c139c61400f5efd88932a6020587..HEAD/versionedparcelable).\n\n**Bug fixes**\n\n- Updated to the latest annotation version for new annotations.\n\n### Version 1.1.0-alpha01\n\nNovember 5, 2018\n\n**New features**\n\n- Added support for CharSequence in all classes except VersionedParcelStream.\n- Added support for SuperClass, Set, and Map.\n\n**Bug fixes**\n\n- Fixed a bug with checking IDs in inherited classes."]]