使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
Versionedparcelable
提供稳定且紧凑的二进制序列化格式,该格式可跨进程传递或安全保留。
最近更新时间 |
稳定版 |
候选版 |
Beta 版 |
Alpha 版 |
2025 年 1 月 29 日 |
1.2.1 |
- |
- |
- |
反馈
您的反馈将帮助我们改进 Jetpack。如果您发现了新问题,或对此库有任何改进建议,请告诉我们。创建新问题前,请先查看此库中的现有问题。您可以点击星标按钮,为现有问题投票。
创建新问题
如需了解详情,请参阅问题跟踪器文档。
版本 1.2
版本 1.2.1
2025 年 1 月 29 日
发布了 androidx.versionedparcelable:versionedparcelable:1.2.1
。版本 1.2.1 包含这些提交内容。
bug 修复
- 更新了
VersionedParcelable
,以避免在解封装的初始阶段执行类初始化,从而防止外部控制的输入在应用类路径中已存在的非 VersionedParcelable
类的静态初始化块中执行意外代码。(Icceed)
- 此库现在使用 JSpecify nullness annotations,即类型使用。Kotlin 开发者应使用以下编译器参数来强制执行正确的用法:
-Xjspecify-annotations=strict
(从 Kotlin 编译器 2.1.0 版开始,这是默认值)。(Ibc328、b/326456246)
- 移除了手动说明对新平台 API 的访问权限,因为当将 R8 与 AGP 7.3 或更高版本(例如 R8 版本 3.3)搭配使用时,系统会通过 API 建模自动执行此操作;当使用 AGP 8.1 或更高版本(例如 D8 版本 8.1)时,系统会针对所有 build 执行此操作。建议不使用 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 以来的重要变更
- 添加了对使用稳定 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 中包含这些提交内容。
bug 修复
- 更新了 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()
现在会返回 null
ParcelUtils.putVersionedParcelable()
现在接受值为 null 的 VersionedParlable 对象
版本 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` 现在支持 null (aosp/940072)
RemoteActionCompat
现在是 VersionedParcelable` (aosp/928534)
版本 1.1.0-alpha02
2019 年 3 月 13 日
发布了 androidx.versionedparcelable:versionedparcelable:1.1.0-alpha02
。点击此处可查看此版本中包含的完整提交内容列表。
bug 修复
版本 1.1.0-alpha01
2018 年 11 月 5 日
新功能
- 在除 VersionedParcelStream 之外的所有类中添加了对 CharSequence 的支持。
- 添加了对 SuperClass、Set 和 Map 的支持。
bug 修复
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-27。
[null,null,["最后更新时间 (UTC):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."]]