# WatchFaceEditorContract

Artifact: [androidx.wear.watchface:watchface-editor](https://developer.android.com/jetpack/androidx/releases/wear-watchface) [View Source](https://cs.android.com/search?q=file:androidx/wear/watchface/editor/WatchFaceEditorContract.kt+class:androidx.wear.watchface.editor.WatchFaceEditorContract) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.0.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

*** ** * ** ***


```
open class WatchFaceEditorContract : ActivityResultContract<EditorRequest, Unit>
```

<br />

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [androidx.activity.result.contract.ActivityResultContract](https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract)\<[EditorRequest](https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/EditorRequest), [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)\> ||
|   | ↳ | [androidx.wear.watchface.editor.WatchFaceEditorContract](https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/WatchFaceEditorContract) |

*** ** * ** ***

> [!CAUTION]
> **This class is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

An `https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract` for invoking a watch face editor. Note watch face editors are invoked by SysUI and the normal activity result isn't used for returning `https://developer.android.com/reference/kotlin/androidx/wear/watchface/client/EditorState` because `https://developer.android.com/reference/android/app/Activity.html#onStop()` isn't guaranteed to be called when SysUI UX needs it to. Instead `https://developer.android.com/reference/kotlin/androidx/wear/watchface/client/EditorState` is broadcast by the editor using`https://developer.android.com/reference/java/lang/AutoCloseable.html#close()`, to observe these broadcasts use `https://developer.android.com/reference/kotlin/androidx/wear/watchface/client/WatchFaceControlClient#getEditorServiceClient()` and `https://developer.android.com/reference/kotlin/androidx/wear/watchface/client/EditorServiceClient#addListener(androidx.wear.watchface.client.EditorListener,java.util.concurrent.Executor)`.

use Watch Face Format instead

## Summary

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/WatchFaceEditorContract#ACTION_WATCH_FACE_EDITOR()` **This property is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |

| ### Public constructors |
|---|
| `[WatchFaceEditorContract](https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/WatchFaceEditorContract#WatchFaceEditorContract())()` **This function is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |

| ### Public functions |
|---|---|
| `open https://developer.android.com/reference/android/content/Intent.html` | `[createIntent](https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/WatchFaceEditorContract#createIntent(android.content.Context,androidx.wear.watchface.editor.EditorRequest))(context: https://developer.android.com/reference/android/content/Context.html, input: https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/EditorRequest)` **This function is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[parseResult](https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/WatchFaceEditorContract#parseResult(kotlin.Int,android.content.Intent))(resultCode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, intent: https://developer.android.com/reference/android/content/Intent.html?)` **This function is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |

### Inherited functions

From [androidx.activity.result.contract.ActivityResultContract](https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract) `open https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract.SynchronousResult<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html>?` `[getSynchronousResult](https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract#getSynchronousResult(android.content.Context,kotlin.Any))(context: https://developer.android.com/reference/android/content/Context.html, input: https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/EditorRequest)`

**This function is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead.

## Constants

### ACTION_WATCH_FACE_EDITOR

```
const val ACTION_WATCH_FACE_EDITOR: String
```

> [!CAUTION]
> **This property is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

## Public constructors

### WatchFaceEditorContract

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.0.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

```
[WatchFaceEditorContract](https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/WatchFaceEditorContract#WatchFaceEditorContract())()
```

> [!CAUTION]
> **This function is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

## Public functions

### createIntent

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.0.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

```
open fun [createIntent](https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/WatchFaceEditorContract#createIntent(android.content.Context,androidx.wear.watchface.editor.EditorRequest))(context: Context, input: EditorRequest): Intent
```

> [!CAUTION]
> **This function is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

Create an intent that can be used for `https://developer.android.com/reference/android/app/Activity.html#startActivityForResult(android.content.Intent, int)`.

### parseResult

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.0.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

```
open fun [parseResult](https://developer.android.com/reference/kotlin/androidx/wear/watchface/editor/WatchFaceEditorContract#parseResult(kotlin.Int,android.content.Intent))(resultCode: Int, intent: Intent?): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

Convert result obtained from `https://developer.android.com/reference/android/app/Activity.html#onActivityResult(int, int, android.content.Intent)` to `https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract`.