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.

Summary

Public constructors

Public methods

@NonNull Intent

Create an intent that can be used for startActivityForResult

void
parseResult(int resultCode, @Nullable Intent intent)

Convert result obtained from onActivityResult to O

Public constructors

WatchFaceEditorContract

public final WatchFaceEditorContract()

Public methods

createIntent

@NonNull
public Intent createIntent(@NonNull Context context, @NonNull EditorRequest input)

Create an intent that can be used for startActivityForResult

parseResult

@NonNull
public void parseResult(int resultCode, @Nullable Intent intent)

Convert result obtained from onActivityResult to O