# EventBuilders.TileInteractionEvent

Artifact: [androidx.wear.tiles:tiles](https://developer.android.com/jetpack/androidx/releases/wear-tiles) [View Source](https://cs.android.com/search?q=file:androidx/wear/tiles/EventBuilders.java+class:androidx.wear.tiles.EventBuilders.TileInteractionEvent) Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.4.0)

*** ** * ** ***


```
@RequiresSchemaVersion(major = 1, minor = 400)
public final class EventBuilders.TileInteractionEvent
```

<br />

*** ** * ** ***

Event reported when a user interacts with a tile (e.g. entering or leaving a tile).

## Summary

| ### Nested types |
|---|
| `public final class https://developer.android.com/reference/androidx/wear/tiles/EventBuilders.TileInteractionEvent.Builder` Builder for `https://developer.android.com/reference/androidx/wear/tiles/EventBuilders.TileInteractionEvent` |

| ### Constants |
|---|---|
| `static final int` | `https://developer.android.com/reference/androidx/wear/tiles/EventBuilders.TileInteractionEvent#ENTER() = 1` User entered the tile. |
| `static final int` | `https://developer.android.com/reference/androidx/wear/tiles/EventBuilders.TileInteractionEvent#LEAVE() = 2` User left the tile. |
| `static final int` | `https://developer.android.com/reference/androidx/wear/tiles/EventBuilders.TileInteractionEvent#UNKNOWN() = 0` Unknown type |

| ### Public methods |
|---|---|
| `int` | `https://developer.android.com/reference/androidx/wear/tiles/EventBuilders.TileInteractionEvent#getEventType()()` Gets the type of the `https://developer.android.com/reference/androidx/wear/tiles/EventBuilders.TileInteractionEvent`. |
| `int` | `https://developer.android.com/reference/androidx/wear/tiles/EventBuilders.TileInteractionEvent#getTileId()()` Gets instance ID of the tile, allocated when the tile instance is added to the carousel. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/time/Instant.html` | `https://developer.android.com/reference/androidx/wear/tiles/EventBuilders.TileInteractionEvent#getTimestamp()()` Gets the timestamp of when the interaction was reported. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/wear/tiles/EventBuilders.TileInteractionEvent#toString()()` |

## Constants

### ENTER

Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.4.0)

```
public static final int ENTER = 1
```

User entered the tile.

### LEAVE

Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.4.0)

```
public static final int LEAVE = 2
```

User left the tile.

### UNKNOWN

Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.4.0)

```
public static final int UNKNOWN = 0
```

Unknown type

## Public methods

### getEventType

Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.4.0)

```
public int getEventType()
```

Gets the type of the `https://developer.android.com/reference/androidx/wear/tiles/EventBuilders.TileInteractionEvent`.

### getTileId

Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.4.0)

```
public int getTileId()
```

Gets instance ID of the tile, allocated when the tile instance is added to the carousel. This ID will remain the same for this tile instance as long it is not removed from the carousel.

### getTimestamp

Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.4.0)

```
public @NonNull Instant getTimestamp()
```

Gets the timestamp of when the interaction was reported. Defaults to `https://developer.android.com/reference/java/time/Instant.html#now()` (Created at the time of `https://developer.android.com/reference/androidx/wear/tiles/EventBuilders.TileInteractionEvent.Builder#Builder(int,int)` constructor call) if not provided.

### toString

```
public @NonNull String toString()
```