จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
Localbroadcastmanager
อาร์ติแฟกต์นี้และคลาสของอาร์ติแฟกต์เลิกใช้งานแล้ว ให้ใช้ LiveData หรือ Reactive Streams แทน
อัปเดตล่าสุด |
รุ่นที่เสถียร |
รุ่นที่อาจได้รับการเผยแพร่ |
รุ่นเบต้า |
เวอร์ชันอัลฟ่า |
12 มกราคม 2022 |
1.1.0 |
- |
- |
- |
ความคิดเห็น
ความคิดเห็นของคุณช่วยปรับปรุง Jetpack ได้ โปรดแจ้งให้เราทราบหากพบปัญหาใหม่หรือมีแนวคิดในการปรับปรุงคลังนี้ โปรดดูปัญหาที่มีอยู่ในคลังนี้ก่อนสร้างปัญหาใหม่ คุณสามารถเพิ่มการโหวตให้กับปัญหาที่มีอยู่ได้โดยคลิกปุ่มดาว
สร้างปัญหาใหม่
ดูข้อมูลเพิ่มเติมในเอกสารประกอบของเครื่องมือติดตามปัญหา
เวอร์ชัน 1.1.0
เวอร์ชัน 1.1.0
12 มกราคม 2022
androidx.localbroadcastmanager:localbroadcastmanager:1.1.0
ได้รับการปล่อยแล้ว เวอร์ชัน 1.1.0 มีคอมมิตเหล่านี้
การเปลี่ยนแปลงที่สําคัญตั้งแต่เวอร์ชัน 1.0.0
androidx.localbroadcastmanager
เลิกใช้งานแล้ว จะไม่มีรุ่นเพิ่มเติมของไลบรารีนี้ นักพัฒนาแอปควรแทนที่การใช้ LocalBroadcastManager
ด้วยการใช้งานรูปแบบที่สังเกตได้อื่นๆ ตัวเลือกที่เหมาะสมอาจเป็น LiveData
หรือสตรีมแบบรีแอ็กทีฟ ทั้งนี้ขึ้นอยู่กับกรณีการใช้งาน
เวอร์ชัน 1.1.0-rc01
15 ธันวาคม 2021
androidx.localbroadcastmanager:localbroadcastmanager:1.1.0-rc01
ได้รับการปล่อยแล้ว เวอร์ชัน 1.1.0-rc01 มีการคอมมิตเหล่านี้
เวอร์ชัน 1.1.0-alpha01
17 ธันวาคม 2018
androidx.localbroadcastmanager
จะเลิกใช้งานในเวอร์ชัน 1.1.0-alpha01
เหตุผล
LocalBroadcastManager
คือบัสเหตุการณ์ทั่วทั้งแอปและยอมรับการละเมิดเลเยอร์ในแอป คอมโพเนนต์ใดก็ได้ที่จะรับฟังเหตุการณ์จากคอมโพเนนต์อื่น
- โดยรับข้อจำกัด Use Case ที่ไม่จำเป็นของระบบ
BroadcastManager
มาด้วย นักพัฒนาแอปต้องใช้ Intent
แม้ว่าออบเจ็กต์จะอยู่ในกระบวนการเดียวและไม่เคยออกจากกระบวนการดังกล่าว ด้วยเหตุนี้ เนื้อหาดังกล่าวจึงไม่เป็นไปตามBroadcastManager
ในแง่ของฟีเจอร์
สิ่งเหล่านี้ทำให้นักพัฒนาแอปได้รับประสบการณ์การใช้งานที่สร้างความสับสน
การเปลี่ยนทดแทน
- คุณสามารถแทนที่การใช้
LocalBroadcastManager
ด้วยการใช้งานรูปแบบที่สังเกตได้อื่นๆ ได้ ตัวเลือกที่เหมาะสมอาจเป็น LiveData
หรือสตรีมแบบรีแอ็กทีฟ ทั้งนี้ขึ้นอยู่กับกรณีการใช้งาน
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา Java และ OpenJDK เป็นเครื่องหมายการค้าหรือเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-27 UTC
[[["เข้าใจง่าย","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 UTC"],[],[],null,["# Localbroadcastmanager\n=====================\n\n[User Guide](/guide/components/broadcasts) [Code Sample](https://github.com/android/location-samples/blob/master/LocationUpdatesForegroundService/app/src/main/java/com/google/android/gms/location/sample/locationupdatesforegroundservice/MainActivity.java) \nAPI Reference \n[androidx.localbroadcastmanager.content](/reference/kotlin/androidx/localbroadcastmanager/content/package-summary) \nThis artifact and its classes are deprecated. Use LiveData or reactive streams instead. \n\n| Latest Update | Stable Release | Release Candidate | Beta Release | Alpha Release |\n|------------------|-----------------------------------------------------------------|-------------------|--------------|---------------|\n| January 12, 2022 | [1.1.0](/jetpack/androidx/releases/localbroadcastmanager#1.1.0) | - | - | - |\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:460939%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=460939&template=1422575)\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\nJanuary 12, 2022\n\n`androidx.localbroadcastmanager:localbroadcastmanager:1.1.0` is released. [Version 1.1.0 contains these commits.](https://android.googlesource.com/platform/frameworks/support/+log/abade69a222024e74015882531553477622890a5..d2d922e60b4cb018c91276a85fb27a05b8a2b0c9/localbroadcastmanager/localbroadcastmanager)\n\n**Important changes since 1.0.0**\n\n`androidx.localbroadcastmanager` has been fully deprecated. There will be no further releases of this library. Developers should replace usages of `LocalBroadcastManager` with other implementations of the observable pattern. Depending on the use case, suitable options may be `LiveData` or reactive streams.\n\n### Version 1.1.0-rc01\n\nDecember 15, 2021\n\n`androidx.localbroadcastmanager:localbroadcastmanager:1.1.0-rc01` is released. [Version 1.1.0-rc01 contains these commits.](https://android.googlesource.com/platform/frameworks/support/+log/86267e31251cdaf875674004b9937ff3da0c3f24..abade69a222024e74015882531553477622890a5/localbroadcastmanager/localbroadcastmanager)\n\n### Version 1.1.0-alpha01\n\nDecember 17, 2018\n\n`androidx.localbroadcastmanager` is being deprecated in version `1.1.0-alpha01`.\n\n**Reason**\n\n- `LocalBroadcastManager` is an application-wide event bus and embraces layer violations in your app; any component may listen to events from any other component.\n- It inherits unnecessary use-case limitations of system `BroadcastManager`; developers have to use `Intent` even though objects live in only one process and never leave it. For this same reason, it doesn't follow feature-wise `BroadcastManager` .\n\nThese add up to a confusing developer experience.\n\n**Replacement**\n\n- You can replace usage of `LocalBroadcastManager` with other implementations of the observable pattern. Depending on your use case, suitable options may be `LiveData` or reactive streams."]]