Back to API Reference
Interface

ISavedStateProvider

abstract

Persists and restores transient editor state — text, selection, scroll position, pending IME composition — across host-driven view recreation. The pattern matches Android SavedStateHandle / iOS UIStateRestoration / Web bfcache (pageshow with persisted=true): the platform hands the editor an opaque dictionary on suspend, hands it back on resume.

Remarks

The platform integration (Android process death restoration, iOS background-app kill, Web bfcache) is P2 work — the interface ships in P1 so integrators wiring their own state-bundle plumbing have a stable contract today.

Implementations(1)

Types that implement ISavedStateProvider.

public abstract void SaveState()

Writes editor state into bundle. Keys use the "unitext." prefix to avoid collisions with caller-owned entries.

public abstract void RestoreState()

Reads editor state from bundle. Missing or wrongly-typed entries are silently ignored; restoration is best-effort.