[[["容易理解","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-06-24 (世界標準時間)。"],[[["After registering a fence, your app needs to add a callback to respond when the fence is triggered."],["Callbacks for fences are implemented using a subclass of `BroadcastReceiver` to manage `Intent` methods."],["The `BroadcastReceiver.onReceive()` method within the subclass handles `Intent` methods from the fences your app has created."],["The `FenceState.extract()` method is used to retrieve the fence state from a received `Intent` and provide it to the callback."]]],["After registering a fence, a callback must be added to respond when it's triggered. This is achieved by creating a subclass of `BroadcastReceiver`. The `FenceReceiver` class, extending `BroadcastReceiver`, implements the `onReceive()` method. Upon receiving an `Intent` from a fence, `FenceState.extract()` retrieves the fence state. The code then checks the fence key and current state (`TRUE`, `FALSE`, or `UNKNOWN`) to update the log view. This allows the app to react to fence state changes.\n"]]