使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
通过此备忘单,您可以快速查看 Jetpack 中提供的不同 ViewModel API,包括包含这些 API 的工件、返回的 ViewModel 实例的范围,以及展示如何使用这些 API 的示例。
备忘单也可以下载 PDF 格式的版本。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):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"]],["最后更新时间 (UTC):2025-07-27。"],[],[],null,["# ViewModel APIs cheat sheet\nPart of [Android Jetpack](/jetpack).\n===============================================================\n\nThis cheat sheet lets you quickly see the different ViewModel APIs available\nin Jetpack including the artifact where they can be found, the scope of the\nreturned ViewModel instance, and an example of how to use them.\n\nThe cheat sheet is also [downloadable in\nPDF format](/static/images/topic/libraries/architecture/viewmodel-apis-cheatsheet.pdf).\n\n[](/static/images/topic/libraries/architecture/viewmodel-apis-cheatsheet.png)"]]