קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
Localbroadcastmanager
פריט המידע הזה שנוצר בתהליך פיתוח (Artifact) והכיתות שלו הוצאו משימוש. במקום זאת, כדאי להשתמש ב-LiveData או ב-reactive streams.
העדכון האחרון |
גרסה יציבה |
גרסה מועמדת להפצה |
גרסת בטא |
גרסה אלפא |
12 בינואר 2022 |
1.1.0 |
- |
- |
- |
משוב
המשוב שלכם עוזר לנו לשפר את Jetpack. אם נתקלתם בבעיות חדשות או שיש לכם רעיונות לשיפור הספרייה הזו, נשמח לשמוע מכם. לפני שיוצרים בעיה חדשה, כדאי לעיין בבעיות הקיימות בספרייה הזו. כדי להצביע על בעיה קיימת, לוחצים על לחצן הכוכב.
דיווח על בעיה חדשה
מידע נוסף זמין במסמכי התיעוד של Issue Tracker.
גרסה 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
הוא אוטובוס אירועים ברמת האפליקציה, והוא מאפשר לטפל בהפרות שכבות באפליקציה. כל רכיב יכול להאזין לאירועים מכל רכיב אחר.
- הוא יורש מגבלות מיותרות של תרחישים לדוגמה במערכת
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."]]