Class AN_Activity
An activity is a single, focused thing that the user can do. Almost all activities interact with the user, so the Activity class takes care of creating a window for you in which you can place your UI with setContentView(View). While activities are often presented to the user as full-screen windows, they can also be used in other ways: as floating windows (via a theme with R.attr.windowIsFloating set) or embedded inside of another activity (using ActivityGroup).
Namespace: SA.Android.App
Assembly: cs.temp.dll.dll
Syntax
public class AN_Activity : AN_Context
Methods
Finish()
Call this when your activity is done and should be closed. The ActivityResult is propagated back to whoever launched the activity.
Declaration
public bool Finish()
Returns
Type | Description |
---|---|
System.Boolean |
GetPackageManager()
Return PackageManager instance to find global package information.
Declaration
public override AN_PackageManager GetPackageManager()
Returns
Type | Description |
---|---|
AN_PackageManager |
MoveTaskToBack(Boolean)
Move the task containing this activity to the back of the activity stack. The activity's order within the task is unchanged
Declaration
public bool MoveTaskToBack(bool nonRoot)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | nonRoot | If false then this only works if the activity is the root of a task; if true it will work for any activity in a task. |
Returns
Type | Description |
---|---|
System.Boolean | If the task was moved (or it was already at the back) true is returned, else false. |
StartActivity(AN_Intent)
Launch a new activity. You will not receive any information about when the activity exits. This implementation overrides the base version, providing information about the activity performing the launch. Because of this additional information, the Intent.FLAG_ACTIVITY_NEW_TASK launch flag is not required; if not specified, the new activity will be added to the task of the caller.
Declaration
public bool StartActivity(AN_Intent intent)
Parameters
Type | Name | Description |
---|---|---|
AN_Intent | intent | The intent to start. |
Returns
Type | Description |
---|---|
System.Boolean |
StartActivityForResult(AN_Intent, Action<AN_ActivityResult>)
Launch an activity for which you would like a result when it finished. When this activity exits, your callback will be called.
Declaration
public bool StartActivityForResult(AN_Intent intent, Action<AN_ActivityResult> callback)
Parameters
Type | Name | Description |
---|---|---|
AN_Intent | intent | The intent to start. |
Action<AN_ActivityResult> | callback | Activity result callback |
Returns
Type | Description |
---|---|
System.Boolean |