Table of Contents

Class AndroidUiContext

Namespace
VpnHood.Core.Client.Devices.Android
Assembly
VpnHood.Core.Client.Devices.Android.dll

Represents the app's UI on Android: an activity, in which the device shows its prompts and the app its ads.

public class AndroidUiContext : IUiContext
Inheritance
AndroidUiContext
Implements
Inherited Members

Constructors

AndroidUiContext(IActivityEvent)

Represents the app's UI on Android: an activity, in which the device shows its prompts and the app its ads.

public AndroidUiContext(IActivityEvent activityEvent)

Parameters

activityEvent IActivityEvent

The activity, with its events.

Properties

Activity

Gets the activity.

public Activity Activity { get; }

Property Value

Activity

ActivityEvent

Gets the activity, with its events.

public IActivityEvent ActivityEvent { get; }

Property Value

IActivityEvent

Methods

IsActive()

Determines whether the UI is shown to the user, as far as the platform tells: Android checks its view, and iOS always answers true.

public Task<bool> IsActive()

Returns

Task<bool>

A task whose result is true if it is; otherwise, false.

Remarks

It asks on the UI thread whether the activity is not destroyed and its window's view is shown; false where that cannot be read.

IsDestroyed()

Determines whether the UI is gone, as far as the platform tells: a desktop reports a hidden window as gone, and iOS never reports one.

public Task<bool> IsDestroyed()

Returns

Task<bool>

A task whose result is true if it is; otherwise, false.

Remarks

It is the activity's own answer; false where that cannot be read.