จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ตัวโหลด
โหลดข้อมูลสําหรับ UI ที่จะยังคงอยู่หลังจากการเปลี่ยนแปลงการกําหนดค่า
อัปเดตล่าสุด |
รุ่นที่เสถียร |
รุ่นที่อาจได้รับการเผยแพร่ |
รุ่นเบต้า |
เวอร์ชันอัลฟ่า |
9 ตุลาคม 2019 |
1.1.0 |
- |
- |
- |
การประกาศทรัพยากร Dependency
หากต้องการเพิ่ม Dependency ใน Loader คุณต้องเพิ่มที่เก็บ Maven ของ Google ลงในโปรเจ็กต์ อ่านข้อมูลเพิ่มเติมในที่เก็บ Maven ของ Google
เพิ่มการอ้างอิงสำหรับอาร์ติแฟกต์ที่ต้องการในไฟล์ build.gradle
สำหรับแอปหรือโมดูล
ดึงดูด
dependencies {
implementation "androidx.loader:loader:1.1.0"
}
Kotlin
dependencies {
implementation("androidx.loader:loader:1.1.0")
}
ดูข้อมูลเพิ่มเติมเกี่ยวกับการพึ่งพาได้ที่เพิ่มการพึ่งพิงบิวด์
ความคิดเห็น
ความคิดเห็นของคุณช่วยปรับปรุง Jetpack ได้ โปรดแจ้งให้เราทราบหากพบปัญหาใหม่หรือมีแนวคิดในการปรับปรุงคลังนี้ โปรดดูปัญหาที่มีอยู่ในคลังนี้ก่อนสร้างปัญหาใหม่ คุณสามารถเพิ่มการโหวตให้กับปัญหาที่มีอยู่ได้โดยคลิกปุ่มดาว
สร้างปัญหาใหม่
ดูข้อมูลเพิ่มเติมในเอกสารประกอบของเครื่องมือติดตามปัญหา
เวอร์ชัน 1.1.0
เวอร์ชัน 1.1.0
9 ตุลาคม 2019
androidx.loader:loader:1.1.0
ได้รับการปล่อยแล้ว เวอร์ชัน 1.1.0 มีการคอมมิตเหล่านี้
การเปลี่ยนแปลงที่สําคัญตั้งแต่เวอร์ชัน 1.0.0
- การเปลี่ยนแปลงผู้ดำเนินการเริ่มต้น: ตอนนี้ผู้ดำเนินการเริ่มต้นสำหรับ
AsyncTaskLoader
(และโดยส่วนขยายแล้ว CursorLoader
) คือ AsyncTask.THREAD_POOL_EXECUTOR
ไม่ใช่ผู้ดำเนินการที่กำหนดเอง
- การตั้งค่า Executor ที่กําหนดเอง: ตอนนี้การใช้งาน
AsyncTaskLoader
หรือคลาสย่อยของ AsyncTaskLoader
ที่กําหนดเองสามารถลบล้าง getExecutor()
เพื่อตั้งค่า Executor ที่กําหนดเองได้แล้ว
เวอร์ชัน 1.1.0-rc01
5 มิถุนายน 2019
androidx.loader:loader:1.1.0-rc01
เผยแพร่โดยไม่มีการเปลี่ยนแปลงจาก 1.1.0-beta01
เวอร์ชัน 1.1.0-beta01
13 มีนาคม 2019
androidx.loader:loader:1.1.0-beta01
ได้รับการปล่อยแล้ว ดูรายการคอมมิตทั้งหมดที่รวมอยู่ในเวอร์ชันนี้ได้ที่นี่
แก้ไขข้อบกพร่อง
- แก้ไขปัญหาที่อาจทำให้เกิด
StaleDataException
เมื่อเริ่มโหลดซ้ำจาก onLoadFinished
(b/123922776)
เวอร์ชัน 1.1.0-alpha01
3 ธันวาคม 2018
ฟีเจอร์ใหม่
- เพิ่มเมธอด
getExecutor()
ไปยัง AsyncTaskLoader
เพื่อให้คุณตั้งค่า Executor ที่กําหนดเองได้ (aosp/810773)
การเปลี่ยนแปลงลักษณะการทำงาน
- ตอนนี้
AsyncTask.THREAD_POOL_EXECUTOR
จะเป็นโปรแกรมที่ใช้เรียกใช้เริ่มต้นของ AsyncTaskLoader
แทนโปรแกรมที่ใช้เรียกใช้ที่กําหนดเอง
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา Java และ OpenJDK เป็นเครื่องหมายการค้าหรือเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-30 UTC
[null,null,["อัปเดตล่าสุด 2025-07-30 UTC"],[],[],null,["# Loader\n======\n\n[User Guide](/guide/components/loaders) [Code Sample](https://github.com/android/architecture-components-samples/blob/master/PersistenceContentProviderSample/app/src/main/java/com/example/android/contentprovidersample/MainActivity.java) \nAPI Reference \n[androidx.loader.app](/reference/kotlin/androidx/loader/app/package-summary) \n[androidx.loader.content](/reference/kotlin/androidx/loader/content/package-summary) \nLoad data for your UI that survives configuration changes. \n\n| Latest Update | Stable Release | Release Candidate | Beta Release | Alpha Release |\n|-----------------|--------------------------------------------------|-------------------|--------------|---------------|\n| October 9, 2019 | [1.1.0](/jetpack/androidx/releases/loader#1.1.0) | - | - | - |\n\nDeclaring dependencies\n----------------------\n\nTo add a dependency on Loader, 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 implementation \"androidx.loader:loader:1.1.0\"\n}\n```\n\n### Kotlin\n\n```kotlin\ndependencies {\n implementation(\"androidx.loader:loader:1.1.0\")\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:460551%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=460551&template=1182829)\n\nSee the [Issue Tracker documentation](https://developers.google.com/issue-tracker)\nfor more information.\n\nVersion 1.1.0\n-------------\n\n### Version 1.1.0\n\nOctober 9, 2019\n\n`androidx.loader:loader:1.1.0` is released. [Version 1.1.0 contains these commits](https://android.googlesource.com/platform/frameworks/support/+log/5201bd4b76d8abd612c147be0b4993f15ee133e3..5b6a7fdfd9ce612fa52f3fe95a9f9cb84fe9364c/loader).\n\n**Important changes since 1.0.0**\n\n- **Default Executor Change** : The default Executor for `AsyncTaskLoader` (and, by extension, `CursorLoader`) is now `AsyncTask.THREAD_POOL_EXECUTOR` rather than a custom Executor.\n- **Setting a custom Executor** : custom implementations of `AsyncTaskLoader` or its subclasses can now override `getExecutor()` to set a custom Executor.\n\n### Version 1.1.0-rc01\n\nJune 5, 2019\n\n`androidx.loader:loader:1.1.0-rc01` is released with no changes from `1.1.0-beta01`.\n\n### Version 1.1.0-beta01\n\nMarch 13, 2019\n\n`androidx.loader:loader:1.1.0-beta01` is released. The full list of commits included in this version can be found [here](https://android.googlesource.com/platform/frameworks/support/+log/b93a1415db20e4d3789c0f3a116f3d556ee6b603..79285e90f077844e4b3b1a72a4a051389e3c190a/loader).\n\n**Bug fixes**\n\n- Fixed an issue which would cause a `StaleDataException` when restarting loader from `onLoadFinished` ([b/123922776](https://issuetracker.google.com/issues/123922776))\n\n### Version 1.1.0-alpha01\n\nDecember 3, 2018\n\n**New features**\n\n- Added a `getExecutor()` method to `AsyncTaskLoader` to allow you to set a custom Executor ([aosp/810773](https://android-review.googlesource.com/c/platform/frameworks/support/+/810773))\n\n**Behavior changes**\n\n- The default Executor for `AsyncTaskLoader` is now `AsyncTask.THREAD_POOL_EXECUTOR` rather than a custom Executor."]]