Оптимизируйте свои подборки
Сохраняйте и классифицируйте контент в соответствии со своими настройками.
После регистрации ограждения ваше приложение должно добавить обратный вызов для ответа на срабатывание ограждения. Вы можете сделать это с помощью подкласса BroadcastReceiver для обработки методов Intent из ограждений.
Прежде чем добавлять обратные вызовы к ограждению, необходимо сначала зарегистрировать ограждение.
Создайте подкласс BroadcastReceiver
В следующем примере показан класс FenceReceiver , который расширяет BroadcastReceiver . Класс реализует метод обратного вызова BroadcastReceiver.onReceive() для обработки всех методов Intent , которые исходят из ограждений, созданных вашим приложением. При получении Intent используется метод FenceState.extract() для получения состояния ограждения и передачи его обратному вызову.
[[["Прост для понимания","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 UTC."],[[["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"]]