# PreviewView.StreamState

Artifact: [androidx.camera:camera-view](https://developer.android.com/jetpack/androidx/releases/camera) [View Source](https://cs.android.com/search?q=file:androidx/camera/view/PreviewView.java+class:androidx.camera.view.PreviewView.StreamState) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/camera#1.1.0)

*** ** * ** ***


```
public enum PreviewView.StreamState
```

<br />

*** ** * ** ***

Definitions for the preview stream state.

## Summary

| ### Enum Values |
|---|---|
| `https://developer.android.com/reference/androidx/camera/view/PreviewView.StreamState#IDLE` | Preview is not visible yet. |
| `https://developer.android.com/reference/androidx/camera/view/PreviewView.StreamState#STREAMING` | Preview is streaming. |

| ### Public methods |
|---|---|
| `static https://developer.android.com/reference/androidx/camera/view/PreviewView.StreamState` | `https://developer.android.com/reference/androidx/camera/view/PreviewView.StreamState#valueOf(java.lang.String)(https://developer.android.com/reference/java/lang/String.html name)` Returns the enum constant of this type with the specified name. |
| `static PreviewView.StreamState[]` | `https://developer.android.com/reference/androidx/camera/view/PreviewView.StreamState#values()()` Returns an array containing the constants of this enum type, in the order they're declared. |

## Enum Values

### IDLE

```
PreviewView.StreamState PreviewView.StreamState.IDLE
```

Preview is not visible yet.

### STREAMING

```
PreviewView.StreamState PreviewView.StreamState.STREAMING
```

Preview is streaming.

This state only guarantees the preview is streaming when the implementation mode is `https://developer.android.com/reference/androidx/camera/view/PreviewView.ImplementationMode#COMPATIBLE`. When in `https://developer.android.com/reference/androidx/camera/view/PreviewView.ImplementationMode#PERFORMANCE` mode, it is possible that the preview becomes visible slightly after the state has changed. For apps requiring a precise signal for when the preview starts, please set `https://developer.android.com/reference/androidx/camera/view/PreviewView.ImplementationMode#COMPATIBLE` mode via `https://developer.android.com/reference/androidx/camera/view/PreviewView#setImplementationMode(androidx.camera.view.PreviewView.ImplementationMode)`.

## Public methods

### valueOf

Added in 1.1.0

```
public static PreviewView.StreamState valueOf(String name)
```

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/camera/view/PreviewView.StreamState` | the enum constant with the specified name |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | if this enum type has no constant with the specified name |

### values

Added in 1.1.0

```
public static PreviewView.StreamState[] values()
```

Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants.

| Returns |
|---|---|
| `PreviewView.StreamState[]` | an array containing the constants of this enum type, in the order they're declared |