Android 12 Developer Preview is here! Try it out, and give us your feedback!

WatchFaceEditorContract

open class WatchFaceEditorContract : ActivityResultContract<EditorRequest, Unit>
kotlin.Any
   ↳ androidx.activity.result.contract.ActivityResultContract<androidx.wear.watchface.editor.EditorRequest, kotlin.Unit>
   ↳ androidx.wear.watchface.editor.WatchFaceEditorContract

An 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 EditorState because Activity.onStop isn't guaranteed to be called when SysUI UX needs it to. Instead EditorState is broadcast by the editor usingEditorSession.close, to observe these broadcasts use WatchFaceControlClient.getEditorServiceClient and EditorServiceClient.registerObserver.

Summary

Constants
const String

Public constructors

An ActivityResultContract for invoking a watch face editor.

Public methods
open Intent
createIntent(context: Context, input: EditorRequest)

open Unit
parseResult(resultCode: Int, intent: Intent?)

Inherited functions

Constants

ACTION_WATCH_FACE_EDITOR

const val ACTION_WATCH_FACE_EDITOR: String
Value: "androidx.wear.watchface.editor.action.WATCH_FACE_EDITOR"

Public constructors

<init>

WatchFaceEditorContract()

An 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 EditorState because Activity.onStop isn't guaranteed to be called when SysUI UX needs it to. Instead EditorState is broadcast by the editor usingEditorSession.close, to observe these broadcasts use WatchFaceControlClient.getEditorServiceClient and EditorServiceClient.registerObserver.

Public methods

createIntent

open fun createIntent(
    context: Context,
    input: EditorRequest
): Intent

parseResult

open fun parseResult(
    resultCode: Int,
    intent: Intent?
): Unit