# EventBuilders.TileInteractionEvent.Builder

# EventBuilders.TileInteractionEvent.Builder

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.Builder)  
Added in[1.4.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.4.0)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/wear/tiles/EventBuilders.TileInteractionEvent.Builder "View this page in Java")

<br />

```
class EventBuilders.TileInteractionEvent.Builder
```

<br />

*** ** * ** ***

Builder for[TileInteractionEvent](https://developer.android.com/reference/kotlin/androidx/wear/tiles/EventBuilders.TileInteractionEvent)

## Summary

|                                                                                                                                                                                                                         ### Public constructors                                                                                                                                                                                                                          |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Builder](https://developer.android.com/reference/kotlin/androidx/wear/tiles/EventBuilders.TileInteractionEvent.Builder#Builder(int,int))`(tileId: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`, eventType: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` A builder for[TileInteractionEvent](https://developer.android.com/reference/kotlin/androidx/wear/tiles/EventBuilders.TileInteractionEvent). |

|                                                                    ### Public functions                                                                     |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [EventBuilders.TileInteractionEvent](https://developer.android.com/reference/kotlin/androidx/wear/tiles/EventBuilders.TileInteractionEvent)                 | [build](https://developer.android.com/reference/kotlin/androidx/wear/tiles/EventBuilders.TileInteractionEvent.Builder#build())`()` Builds an instance from accumulated values.                                                                                                                                                                                                                                                                                                 |
| [EventBuilders.TileInteractionEvent.Builder](https://developer.android.com/reference/kotlin/androidx/wear/tiles/EventBuilders.TileInteractionEvent.Builder) | `@`[RequiresSchemaVersion](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/RequiresSchemaVersion)`(major = 1, minor = 400)` [setTimestamp](https://developer.android.com/reference/kotlin/androidx/wear/tiles/EventBuilders.TileInteractionEvent.Builder#setTimestamp(java.time.Instant))`(instant: `[Instant](https://developer.android.com/reference/java/time/Instant.html)`)` Sets the timestamp of when the interaction was reported. |

## Public constructors

### Builder

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

```
Builder(tileId: Int, eventType: Int)
```

A builder for[TileInteractionEvent](https://developer.android.com/reference/kotlin/androidx/wear/tiles/EventBuilders.TileInteractionEvent).  

|                                        Parameters                                        |
|------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `tileId: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)    | the 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. |
| `eventType: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | the type of the[TileInteractionEvent](https://developer.android.com/reference/kotlin/androidx/wear/tiles/EventBuilders.TileInteractionEvent).                                            |

|                                                        Throws                                                         |
|-----------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [java.lang.IllegalArgumentException](https://developer.android.com/reference/java/lang/IllegalArgumentException.html) | when the provided`eventType`is equal to[UNKNOWN](https://developer.android.com/reference/kotlin/androidx/wear/tiles/EventBuilders.TileInteractionEvent#UNKNOWN())or not defined by[EventType](https://developer.android.com/reference/kotlin/androidx/wear/tiles/EventBuilders.TileInteractionEvent.EventType). |

## Public functions

### build

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

```
fun build(): EventBuilders.TileInteractionEvent
```

Builds an instance from accumulated values.  

### setTimestamp

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

```
@RequiresSchemaVersion(major = 1, minor = 400)
fun setTimestamp(instant: Instant): EventBuilders.TileInteractionEvent.Builder
```

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