AutoSuspendHelper class¶
Attributes: [DebuggerDisplay("AutoSuspendHelper")]
Defined in
Namespace: ReactiveUI.Reactive
Assembly: ReactiveUI.Reactive.dll
Full name: ReactiveUI.Reactive.AutoSuspendHelper
Modifiers: public
Summary¶
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¶
| Name | Summary |
|---|---|
| .ctor | Initializes a new instance of the [AutoSuspendHelper](# class. |
Properties¶
| Name | Summary |
|---|---|
| static UntimelyDemise | Gets a subject to indicate whether the application has untimely dismissed. |
| static LatestBundle | Gets or sets the latest bundle. |
Methods¶
| Name | Summary |
|---|---|
| Dispose |