MCPcopy Create free account
hub / github.com/M66B/FairEmail / removeObservers

Method removeObservers

app/src/main/java/androidx/lifecycle/LiveData.java:259–268  ·  view source on GitHub ↗

Removes all observers that are tied to the given LifecycleOwner. @param owner The LifecycleOwner scope for the observers to be removed.

(final @NonNull LifecycleOwner owner)

Source from the content-addressed store, hash-verified

257 * @param owner The {@code LifecycleOwner} scope for the observers to be removed.
258 */
259 @SuppressWarnings("WeakerAccess")
260 @MainThread
261 public void removeObservers(final @NonNull LifecycleOwner owner) {
262 assertMainThread("removeObservers");
263 for (Map.Entry<Observer<? super T>, ObserverWrapper> entry : mObservers) {
264 if (entry.getValue().isAttachedTo(owner)) {
265 removeObserver(entry.getKey());
266 }
267 }
268 }
269
270 /**
271 * Posts a task to a main thread to set the given value. So if you have a following code

Callers 3

getModelMethod · 0.80
onDestroyedMethod · 0.80
onPostExecuteMethod · 0.80

Calls 5

assertMainThreadMethod · 0.95
removeObserverMethod · 0.95
getValueMethod · 0.65
isAttachedToMethod · 0.45
getKeyMethod · 0.45

Tested by

no test coverage detected