Android Guides | Samples

Android.App.ActivityAttribute Class

Generates a /manifest/application/activity element within AndroidManifest.xml.

See Also: ActivityAttribute

Syntax

[System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=false, Inherited=false)]
public sealed class ActivityAttribute : Attribute

Remarks

The //activity element is used to declare an activity that implements part of the application's visual user interface. The ActivityAttribute custom attribute is used by monodroid.exe when generating AndroidManifest.xml to to declaratively generate //activity elements.

The type this attribute is placed on must be a (possibly indirect) subclass of Activity.

The following type declaration

C# Example

[Activity (Name="mono.samples.HelloApp", 
        Label="Hello! Wie gehts!", 
        MainLauncher=true,
        ConfigurationChanges=ConfigChanges.Mcc|ConfigChanges.Mnc,
        LaunchMode=LaunchMode.Multiple,
        ScreenOrientation=ScreenOrientation.Unspecified,
        WindowSoftInputMode=SoftInput.StateUnspecified|SoftInput.AdjustUnspecified)]
class MyActivity : Activity {
}

results in the following XML fragment

XML Example

<activity android:configChanges="mcc|mnc"
            android:label="Hello! Wie gehts!" 
            android:launchMode="standard" 
            android:name="mono.samples.HelloApp" 
            android:screenOrientation="unspecified" 
            android:windowSoftInputMode="stateUnspecified|adjustUnspecified">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>

Requirements

Namespace: Android.App
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0

The members of Android.App.ActivityAttribute are listed below.

See Also: Attribute

Public Constructors

Constructs and initializes a new ActivityAttribute instance.

Public Properties

AllowEmbeddedBoolean.
AllowTaskReparentingBoolean. Whether or not the activity can move from the tasdk that started it to the task it has an affinity for.
AlwaysRetainTaskStateBoolean. Whether or not the state of the task that the activity is in will always be maintained by the system.
ClearTaskOnLaunchBoolean. Whether or not all activities will be removed from the task, except for the root activity, whenever it is re-launched from the home screen.
ConfigurationChangesConfigChanges. The configuration changes that the activity will handle itself.
EnabledBoolean. Whether or not the activity can be instantiated by the system.
ExcludeFromRecentsBoolean. Whether or not the activity should be excluded from the list of recently launched activities.
ExportedBoolean. Whether or not the activity can be launched by components of other applications.
FinishOnTaskLaunchBoolean. Whether or not an existing instance of the activity should be shut down whenever the user again launches its task.
HardwareAcceleratedBoolean.
IconString. An icon representing the activity.
LabelString. A user-readable label for the activity.
LaunchModeLaunchMode. How the activity should be launched.
LayoutDirectionLayoutDirection.
MainLauncherBoolean. Whether or not the activity should be the main launcher for an application.
MultiProcessBoolean. Whether an instance of the activity can be launched into the process of the component that started it.
NameString. The name of the class that implements the activity.
NoHistoryBoolean. Whether or not the activity should be removed from the activity stack and finished when the user navigates away.
ParentActivityType.
PermissionString. The name of a permission that clients must have to launch the activity.
ProcessString. The name of the process in which the activity should run.
ScreenOrientationScreenOrientation. The orientation of the activity's display on the device.
StateNotNeededBoolean. Whether or not the activity can be killed and successfully restarted without having saved its state.
TaskAffinityString. The task that the activity has an affinity for.
ThemeString. A reference to a style resource defining an overall theme for the activity.
UiOptionsUiOptions.
WindowSoftInputModeSoftInput. How the main window of the activity interacts with the window containing hte on-screen soft keyboard.