Class AndroidAppMainActivity
- Namespace
- VpnHood.AppLib.App.Android.Activities
- Assembly
- VpnHood.AppLib.App.Android.dll
Represents a head's main activity that leaves its work to the app's main activity handler, which it makes as it is created (CreateMainActivityHandler()).
public abstract class AndroidAppMainActivity : ActivityEvent, IComponentCallbacks2, IComponentCallbacks, KeyEvent.ICallback, LayoutInflater.IFactory2, LayoutInflater.IFactory, View.IOnCreateContextMenuListener, Window.ICallback, IJavaObject, IJavaPeerable, IDisposable, IActivityEvent
- Inheritance
-
AndroidAppMainActivity
- Implements
- Derived
- Inherited Members
Methods
CreateMainActivityHandler()
Creates the handler that does the activity's work for the app.
protected abstract AndroidAppMainActivityHandler CreateMainActivityHandler()
Returns
- AndroidAppMainActivityHandler
The handler.
OnCreate(Bundle?)
Called when the activity is starting.
protected override void OnCreate(Bundle? savedInstanceState)
Parameters
savedInstanceStateBundleIf the activity is being re-initialized after previously being shut down then this Bundle contains the data it most recently supplied in
#onSaveInstanceState. <b>Note: Otherwise it is null.</b>
Remarks
Called when the activity is starting. This is where most initialization should go: calling setContentView(int) to inflate the activity's UI, using findViewById(int) to programmatically interact with widgets in the UI, calling managedQuery(android.net.Uri,String[],String,String[],String) to retrieve cursors for data being displayed, etc. You can call finish() from within this function, in which case onDestroy() will be immediately called after onCreate(Bundle) without any of the rest of the activity lifecycle (onStart(), onResume(), onPause(), etc.) executing. Derived classes must call through to the super class's implementation of this method. If they do not, an exception will be thrown.
See also:
Portions of this page are modifications based on work created and shared by the
OnCreateRedirectingTo<TActivity>(Bundle?)
Creates this activity only to hand its launch, with its intent, to another activity, and finishes: for a head that ships a second UI. A head calls it from OnCreate(Bundle?) in place of the base's.
protected void OnCreateRedirectingTo<TActivity>(Bundle? savedInstanceState) where TActivity : Activity
Parameters
savedInstanceStateBundleThe state Android saved, as OnCreate(Bundle?) was given it.
Type Parameters
TActivityThe activity that takes the launch.
Remarks
No handler is made for an activity about to finish; the intent goes along, so an access key in it reaches the activity that takes the launch, where that one handles it.