WatchFaceEditorContract


public class WatchFaceEditorContract extends ActivityResultContract


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.addListener.

use Watch Face Format instead

Summary

Constants

static final @NonNull String

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

Public constructors

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

Public methods

@NonNull Intent

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

void
parseResult(int resultCode, Intent intent)

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

Inherited methods

From androidx.activity.result.contract.ActivityResultContract
ActivityResultContract.SynchronousResult<Unit>
getSynchronousResult(
    @NonNull Context context,
    @NonNull EditorRequest input
)

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

Constants

ACTION_WATCH_FACE_EDITOR

public static final @NonNull String ACTION_WATCH_FACE_EDITOR

Public constructors

WatchFaceEditorContract

Added in 1.0.0
Deprecated in 1.3.0-alpha06
public WatchFaceEditorContract()

Public methods

createIntent

Added in 1.0.0
Deprecated in 1.3.0-alpha06
public @NonNull Intent createIntent(@NonNull Context context, @NonNull EditorRequest input)

Create an intent that can be used for android.app.Activity.startActivityForResult.

parseResult

Added in 1.0.0
Deprecated in 1.3.0-alpha06
public void parseResult(int resultCode, Intent intent)

Convert result obtained from android.app.Activity.onActivityResult to O.