# WatcherRegistration

Artifact: [androidx.test.uiautomator:uiautomator](https://developer.android.com/jetpack/androidx/releases/test-uiautomator) [View Source](https://cs.android.com/search?q=file:androidx/test/uiautomator/watcher/Watcher.kt+class:androidx.test.uiautomator.watcher.WatcherRegistration) Added in [2.4.1](https://developer.android.com/jetpack/androidx/releases/test-uiautomator#2.4.1)

*** ** * ** ***


```
public interface WatcherRegistration extends AutoCloseable
```

<br />

*** ** * ** ***

Defines a registration, returned when registering a watcher. Through this interface a watcher can be unregistered. `https://developer.android.com/reference/androidx/test/uiautomator/watcher/WatcherRegistration` extends a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-auto-closeable/index.html` so it can be used with `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/index.html` api. Unregistering a watcher will ensure its visibility condition is

## Summary

| ### Public methods |
|---|---|
| `default void` | `https://developer.android.com/reference/androidx/test/uiautomator/watcher/WatcherRegistration#close()()` |
| `abstract void` | `https://developer.android.com/reference/androidx/test/uiautomator/watcher/WatcherRegistration#unregister()()` Unregisters the dialog associated to this registration. |

## Public methods

### close

Added in [2.4.1](https://developer.android.com/jetpack/androidx/releases/test-uiautomator#2.4.1)

```
default void close()
```

### unregister

Added in [2.4.1](https://developer.android.com/jetpack/androidx/releases/test-uiautomator#2.4.1)

```
abstract void unregister()
```

Unregisters the dialog associated to this registration.