Skip to content

AutoSuspendHelper class

Attributes: [DebuggerDisplay("AutoSuspendHelper")]

Defined in

Namespace: ReactiveUI.Reactive Assembly: ReactiveUI.Reactive.dll Full name: ReactiveUI.Reactive.AutoSuspendHelper Modifiers: public

Summary

View source

Helps manage android application lifecycle events.

Applies to

net10.0-android36.0, net10.0-windows10.0.19041, net9.0-windows10.0.19041, net8.0-windows10.0.19041, net462, net481, net471

Class hierarchy
classDiagram
class AutoSuspendHelper
class IEnableLogger {
    <>
}
IEnableLogger <|.. AutoSuspendHelper
class IDisposable {
    <>
}
IDisposable <|.. AutoSuspendHelper

Implements: IEnableLogger, IDisposable

Remarks

Register this helper inside your Application subclass to translate Activity lifecycle callbacks into SuspensionHost signals. The helper automatically distinguishes cold starts from restores by inspecting LatestBundle and routes pause/save events to ISuspensionDriver via SetupDefaultSuspendResume.

Example usage:

<![CDATA[
 [Application]
 public class App : Application
 {
 private AutoSuspendHelper? _autoSuspendHelper;
 public App(IntPtr handle, JniHandleOwnership ownership)
 : base(handle, ownership)
 {
 }
 public override void OnCreate()
 {
 base.OnCreate();
 _autoSuspendHelper = new AutoSuspendHelper(this);
 RxSuspension.SuspensionHost.CreateNewAppState = () => new ShellState();
 RxSuspension.SuspensionHost.SetupDefaultSuspendResume(new FileSuspensionDriver(FilesDir!.AbsolutePath));
 }
 }
 ]]>

Constructors

NameSummary
.ctorInitializes a new instance of the [AutoSuspendHelper](# class.

Properties

NameSummary
static UntimelyDemiseGets a subject to indicate whether the application has untimely dismissed.
static LatestBundleGets or sets the latest bundle.

Methods

NameSummary
Dispose
Inherited members