Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Ctors](https://developer.android.com/reference/com/google/wear/input/ForegroundGestureSubscriptionParams.Builder#pubctors) \| [Methods](https://developer.android.com/reference/com/google/wear/input/ForegroundGestureSubscriptionParams.Builder#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/com/google/wear/input/ForegroundGestureSubscriptionParams.Builder#inhmethods)

# ForegroundGestureSubscriptionParams.Builder


`
public
static
final

class
ForegroundGestureSubscriptionParams.Builder
`


`

extends Object


`

`


`

|---|---|
| java.lang.Object ||
| ↳ | com.google.wear.input.ForegroundGestureSubscriptionParams.Builder |

<br />

*** ** * ** ***

Builder for `https://developer.android.com/reference/com/google/wear/input/ForegroundGestureSubscriptionParams`.

## Summary

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/com/google/wear/input/ForegroundGestureSubscriptionParams.Builder#Builder(int[],%20android.view.View)(int[] actions, View view) ` Constructs a new instance of `https://developer.android.com/reference/com/google/wear/input/ForegroundGestureSubscriptionParams` for a View-based subscription. |
| ` https://developer.android.com/reference/com/google/wear/input/ForegroundGestureSubscriptionParams.Builder#Builder(int[],%20android.view.Window)(int[] actions, Window window) ` Constructs a new instance of `https://developer.android.com/reference/com/google/wear/input/ForegroundGestureSubscriptionParams` for a Window-based subscription. |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/com/google/wear/input/ForegroundGestureSubscriptionParams` | ` https://developer.android.com/reference/com/google/wear/input/ForegroundGestureSubscriptionParams.Builder#build()() ` Builds a new `https://developer.android.com/reference/com/google/wear/input/ForegroundGestureSubscriptionParams` from this builder object. |
| ` https://developer.android.com/reference/com/google/wear/input/ForegroundGestureSubscriptionParams.Builder` | ` https://developer.android.com/reference/com/google/wear/input/ForegroundGestureSubscriptionParams.Builder#setAmbientSupported(boolean)(boolean ambientSupported) ` Sets whether `https://developer.android.com/reference/com/google/wear/input/GestureEvent`s should be detected and dispatched in ambient mode. |

| ### Inherited methods |
|---|---|
| From class ` java.lang.Object ` |---|---| | ` Object` | ` clone() ` | | ` boolean` | ` equals(Object arg0) ` | | ` void` | ` finalize() ` | | ` final Class<?>` | ` getClass() ` | | ` int` | ` hashCode() ` | | ` final void` | ` notify() ` | | ` final void` | ` notifyAll() ` | | ` String` | ` toString() ` | | ` final void` | ` wait(long arg0, int arg1) ` | | ` final void` | ` wait(long arg0) ` | | ` final void` | ` wait() ` | ||

## Public constructors

### Builder

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Builder (int[] actions, 
                View view)
```

Constructs a new instance of `https://developer.android.com/reference/com/google/wear/input/ForegroundGestureSubscriptionParams` for a View-based
subscription.

<br />

| Parameters ||
|---|---|
| `actions` | `int`: an array of all the actions to subscribe to. This must be NOT empty, and all actions in this array must be supported (see `https://developer.android.com/reference/com/google/wear/input/GestureInputManager#isActionSupported(int)`). Value is one of the following: - `https://developer.android.com/reference/com/google/wear/input/GestureEvent#ACTION_PRIMARY` - `https://developer.android.com/reference/com/google/wear/input/GestureEvent#ACTION_DISMISS` |
| `view` | `View`: the `https://developer.android.com/reference/android/view/View` on which received `https://developer.android.com/reference/com/google/wear/input/GestureEvent`s will be processed. Events are delivered only while the Window hosting this View has focus. <br /> |

### Builder

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Builder (int[] actions, 
                Window window)
```

Constructs a new instance of `https://developer.android.com/reference/com/google/wear/input/ForegroundGestureSubscriptionParams` for a
Window-based subscription.

<br />

| Parameters ||
|---|---|
| `actions` | `int`: an array of all the actions to subscribe to. This must be NOT empty, and all actions in this array must be supported (see `https://developer.android.com/reference/com/google/wear/input/GestureInputManager#isActionSupported(int)`). Value is one of the following: - `https://developer.android.com/reference/com/google/wear/input/GestureEvent#ACTION_PRIMARY` - `https://developer.android.com/reference/com/google/wear/input/GestureEvent#ACTION_DISMISS` |
| `window` | `Window`: the `https://developer.android.com/reference/android/view/Window` on which received `https://developer.android.com/reference/com/google/wear/input/GestureEvent`s will be processed. This window should have a View attached (`https://developer.android.com/reference/android/view/Window#peekDecorView()` should not be `null`). Otherwise, an `https://developer.android.com/reference/java/lang/IllegalArgumentException` will be thrown. Events are delivered to the `listener` only while this window has focus. <br /> |

## Public methods

### build

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public ForegroundGestureSubscriptionParams build ()
```

Builds a new `https://developer.android.com/reference/com/google/wear/input/ForegroundGestureSubscriptionParams` from this builder object.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/com/google/wear/input/ForegroundGestureSubscriptionParams` | <br /> |

### setAmbientSupported

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public ForegroundGestureSubscriptionParams.Builder setAmbientSupported (boolean ambientSupported)
```

Sets whether `https://developer.android.com/reference/com/google/wear/input/GestureEvent`s should be detected and dispatched in ambient mode. If
`false`, this subscription will be only for when the display's state is `https://developer.android.com/reference/android/view/Display#STATE_ON`.

<br />

| Parameters ||
|---|---|
| `ambientSupported` | `boolean` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/com/google/wear/input/ForegroundGestureSubscriptionParams.Builder` | <br /> |