On Sustained Memory Pressure Listener
Listener notified when critical native memory pressure persists despite the SDK's automatic recovery.
Under critical memory pressure the SDK recovers automatically: page caches are trimmed, in-flight page renders are aborted and backed off, and affected pages re-render once memory recovers. All of that is silent — transient pressure episodes never invoke this listener.
Only when pressure remains critical for several consecutive memory polls — meaning the automatic recovery could not bring memory back down, typically because the open document itself requires more memory than the device can sustain — is this listener invoked, once per pressure episode. The recommended response is to reduce memory at the source: close or replace the document (finish the hosting activity, swap the document, or remove the fragment). There is nothing to resume or undo — if the host takes no action, the SDK keeps operating in its degraded-but-safe mode (some pages may stay blank until memory recovers).
The listener is invoked on the main thread. Register via PdfFragment.setOnSustainedMemoryPressureListener.