Sdílet prostřednictvím


Activity Class

Definition

An activity is a single, focused thing that the user can do.

[Android.Runtime.Register("android/app/Activity", DoNotGenerateAcw=true)]
public class Activity : Android.Views.ContextThemeWrapper, Android.Content.IComponentCallbacks2, Android.Views.KeyEvent.ICallback, Android.Views.LayoutInflater.IFactory2, Android.Views.View.IOnCreateContextMenuListener, Android.Views.Window.ICallback, IDisposable, Java.Interop.IJavaPeerable
[<Android.Runtime.Register("android/app/Activity", DoNotGenerateAcw=true)>]
type Activity = class
    inherit ContextThemeWrapper
    interface IComponentCallbacks
    interface IJavaObject
    interface IDisposable
    interface IJavaPeerable
    interface IComponentCallbacks2
    interface KeyEvent.ICallback
    interface LayoutInflater.IFactory
    interface LayoutInflater.IFactory2
    interface View.IOnCreateContextMenuListener
    interface Window.ICallback
Inheritance
Derived
Attributes
Implements

Remarks

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. 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 android.R.attr#windowIsFloating set), Multi-Window mode or embedded into other windows.

There are two methods almost all subclasses of Activity will implement:

<ul> <li> #onCreate is where you initialize your activity. Most importantly, here you will usually call #setContentView(int) with a layout resource defining your UI, and using #findViewById to retrieve the widgets in that UI that you need to interact with programmatically.

<li> #onPause is where you deal with the user pausing active interaction with the activity. Any changes made by the user should at this point be committed (usually to the android.content.ContentProvider holding the data). In this state the activity is still visible on screen. </ul>

To be of use with android.content.Context#startActivity Context.startActivity(), all activity classes must have a corresponding android.R.styleable#AndroidManifestActivity &lt;activity&gt; declaration in their package's AndroidManifest.xml.

Topics covered here: <ol> <li>Fragments<li>Activity Lifecycle<li>Configuration Changes<li>Starting Activities and Getting Results<li>Saving Persistent State<li>Permissions<li>Process Lifecycle</ol>

<div class="special reference"> <h3>Developer Guides</h3>

The Activity class is an important part of an application's overall lifecycle, and the way activities are launched and put together is a fundamental part of the platform's application model. For a detailed perspective on the structure of an Android application and how activities behave, please read the Application Fundamentals and Tasks and Back Stack developer guides.

You can also find a detailed discussion about how to create activities in the Activities developer guide.

</div>

"Fragments"><h3>Fragments</h3>

The androidx.fragment.app.FragmentActivity subclass can make use of the androidx.fragment.app.Fragment class to better modularize their code, build more sophisticated user interfaces for larger screens, and help scale their application between small and large screens.

For more information about using fragments, read the Fragments developer guide.

"ActivityLifecycle"><h3>Activity Lifecycle</h3>

Activities in the system are managed as activity stacks. When a new activity is started, it is usually placed on the top of the current stack and becomes the running activity -- the previous activity always remains below it in the stack, and will not come to the foreground again until the new activity exits. There can be one or multiple activity stacks visible on screen.

An activity has essentially four states:

<ul> <li>If an activity is in the foreground of the screen (at the highest position of the topmost stack), it is <em>active</em> or <em>running</em>. This is usually the activity that the user is currently interacting with.</li> <li>If an activity has lost focus but is still presented to the user, it is <em>visible</em>. It is possible if a new non-full-sized or transparent activity has focus on top of your activity, another activity has higher position in multi-window mode, or the activity itself is not focusable in current windowing mode. Such activity is completely alive (it maintains all state and member information and remains attached to the window manager). <li>If an activity is completely obscured by another activity, it is <em>stopped</em> or <em>hidden</em>. It still retains all state and member information, however, it is no longer visible to the user so its window is hidden and it will often be killed by the system when memory is needed elsewhere.</li> <li>The system can drop the activity from memory by either asking it to finish, or simply killing its process, making it <em>destroyed</em>. When it is displayed again to the user, it must be completely restarted and restored to its previous state.</li> </ul>

The following diagram shows the important state paths of an Activity. The square rectangles represent callback methods you can implement to perform operations when the Activity moves between states. The colored ovals are major states the Activity can be in.

<img src="../../../images/activity_lifecycle.png" alt="State diagram for an Android Activity Lifecycle." border="0" />

There are three key loops you may be interested in monitoring within your activity:

<ul> <li>The <b>entire lifetime</b> of an activity happens between the first call to android.app.Activity#onCreate through to a single final call to android.app.Activity#onDestroy. An activity will do all setup of "global" state in onCreate(), and release all remaining resources in onDestroy(). For example, if it has a thread running in the background to download data from the network, it may create that thread in onCreate() and then stop the thread in onDestroy().

<li>The <b>visible lifetime</b> of an activity happens between a call to android.app.Activity#onStart until a corresponding call to android.app.Activity#onStop. During this time the user can see the activity on-screen, though it may not be in the foreground and interacting with the user. Between these two methods you can maintain resources that are needed to show the activity to the user. For example, you can register a android.content.BroadcastReceiver in onStart() to monitor for changes that impact your UI, and unregister it in onStop() when the user no longer sees what you are displaying. The onStart() and onStop() methods can be called multiple times, as the activity becomes visible and hidden to the user.

<li>The <b>foreground lifetime</b> of an activity happens between a call to android.app.Activity#onResume until a corresponding call to android.app.Activity#onPause. During this time the activity is visible, active and interacting with the user. An activity can frequently go between the resumed and paused states -- for example when the device goes to sleep, when an activity result is delivered, when a new intent is delivered -- so the code in these methods should be fairly lightweight. </ul>

The entire lifecycle of an activity is defined by the following Activity methods. All of these are hooks that you can override to do appropriate work when the activity changes state. All activities will implement android.app.Activity#onCreate to do their initial setup; many will also implement android.app.Activity#onPause to commit changes to data and prepare to pause interacting with the user, and android.app.Activity#onStop to handle no longer being visible on screen. You should always call up to your superclass when implementing these methods.

</p>

public class Activity extends ApplicationContext {
                protected void onCreate(Bundle savedInstanceState);

                protected void onStart();

                protected void onRestart();

                protected void onResume();

                protected void onPause();

                protected void onStop();

                protected void onDestroy();
            }

In general the movement through an activity's lifecycle looks like this:

<table border="2" width="85%" align="center" frame="hsides" rules="rows"> <colgroup align="left" span="3" /> <colgroup align="left" /> <colgroup align="center" /> <colgroup align="center" />

<thead> <tr><th colspan="3">Method</th> <th>Description</th> <th>Killable?</th> <th>Next</th></tr> </thead>

<tbody> <tr><td colspan="3" align="left" border="0">android.app.Activity#onCreate onCreate()</td> <td>Called when the activity is first created. This is where you should do all of your normal static set up: create views, bind data to lists, etc. This method also provides you with a Bundle containing the activity's previously frozen state, if there was one.

Always followed by onStart().</td> <td align="center">No</td> <td align="center">onStart()</td> </tr>

<tr><td rowspan="5" style="border-left: none; border-right: none;">&nbsp;&nbsp;&nbsp;&nbsp;</td> <td colspan="2" align="left" border="0">android.app.Activity#onRestart onRestart()</td> <td>Called after your activity has been stopped, prior to it being started again.

Always followed by onStart()</td> <td align="center">No</td> <td align="center">onStart()</td> </tr>

<tr><td colspan="2" align="left" border="0">android.app.Activity#onStart onStart()</td> <td>Called when the activity is becoming visible to the user.

Followed by onResume() if the activity comes to the foreground, or onStop() if it becomes hidden.</td> <td align="center">No</td> <td align="center">onResume() or onStop()</td> </tr>

<tr><td rowspan="2" style="border-left: none;">&nbsp;&nbsp;&nbsp;&nbsp;</td> <td align="left" border="0">android.app.Activity#onResume onResume()</td> <td>Called when the activity will start interacting with the user. At this point your activity is at the top of its activity stack, with user input going to it.

Always followed by onPause().</td> <td align="center">No</td> <td align="center">onPause()</td> </tr>

<tr><td align="left" border="0">android.app.Activity#onPause onPause()</td> <td>Called when the activity loses foreground state, is no longer focusable or before transition to stopped/hidden or destroyed state. The activity is still visible to user, so it's recommended to keep it visually active and continue updating the UI. Implementations of this method must be very quick because the next activity will not be resumed until this method returns.

Followed by either onResume() if the activity returns back to the front, or onStop() if it becomes invisible to the user.</td> <td align="center"><font color="#800000"><strong>Pre-android.os.Build.VERSION_CODES#HONEYCOMB</strong></font></td> <td align="center">onResume() or<br> onStop()</td> </tr>

<tr><td colspan="2" align="left" border="0">android.app.Activity#onStop onStop()</td> <td>Called when the activity is no longer visible to the user. This may happen either because a new activity is being started on top, an existing one is being brought in front of this one, or this one is being destroyed. This is typically used to stop animations and refreshing the UI, etc.

Followed by either onRestart() if this activity is coming back to interact with the user, or onDestroy() if this activity is going away.</td> <td align="center"><font color="#800000"><strong>Yes</strong></font></td> <td align="center">onRestart() or<br> onDestroy()</td> </tr>

<tr><td colspan="3" align="left" border="0">android.app.Activity#onDestroy onDestroy()</td> <td>The final call you receive before your activity is destroyed. This can happen either because the activity is finishing (someone called Activity#finish on it), or because the system is temporarily destroying this instance of the activity to save space. You can distinguish between these two scenarios with the Activity#isFinishing method.</td> <td align="center"><font color="#800000"><strong>Yes</strong></font></td> <td align="center"><em>nothing</em></td> </tr> </tbody> </table>

Note the "Killable" column in the above table -- for those methods that are marked as being killable, after that method returns the process hosting the activity may be killed by the system <em>at any time</em> without another line of its code being executed. Because of this, you should use the #onPause method to write any persistent data (such as user edits) to storage. In addition, the method #onSaveInstanceState(Bundle) is called before placing the activity in such a background state, allowing you to save away any dynamic instance state in your activity into the given Bundle, to be later received in #onCreate if the activity needs to be re-created. See the Process Lifecycle section for more information on how the lifecycle of a process is tied to the activities it is hosting. Note that it is important to save persistent data in #onPause instead of #onSaveInstanceState because the latter is not part of the lifecycle callbacks, so will not be called in every situation as described in its documentation.

<p class="note">Be aware that these semantics will change slightly between applications targeting platforms starting with android.os.Build.VERSION_CODES#HONEYCOMB vs. those targeting prior platforms. Starting with Honeycomb, an application is not in the killable state until its #onStop has returned. This impacts when #onSaveInstanceState(Bundle) may be called (it may be safely called after #onPause()) and allows an application to safely wait until #onStop() to save persistent state.</p>

<p class="note">For applications targeting platforms starting with android.os.Build.VERSION_CODES#P#onSaveInstanceState(Bundle) will always be called after #onStop, so an application may safely perform fragment transactions in #onStop and will be able to save persistent state later.</p>

For those methods that are not marked as being killable, the activity's process will not be killed by the system starting from the time the method is called and continuing after it returns. Thus an activity is in the killable state, for example, between after onStop() to the start of onResume(). Keep in mind that under extreme memory pressure the system can kill the application process at any time.

"ConfigurationChanges"><h3>Configuration Changes</h3>

If the configuration of the device (as defined by the Configuration Resources.Configuration class) changes, then anything displaying a user interface will need to update to match that configuration. Because Activity is the primary mechanism for interacting with the user, it includes special support for handling configuration changes.

Unless you specify otherwise, a configuration change (such as a change in screen orientation, language, input devices, etc) will cause your current activity to be <em>destroyed</em>, going through the normal activity lifecycle process of #onPause, #onStop, and #onDestroy as appropriate. If the activity had been in the foreground or visible to the user, once #onDestroy is called in that instance then a new instance of the activity will be created, with whatever savedInstanceState the previous instance had generated from #onSaveInstanceState.

This is done because any application resource, including layout files, can change based on any configuration value. Thus the only safe way to handle a configuration change is to re-retrieve all resources, including layouts, drawables, and strings. Because activities must already know how to save their state and re-create themselves from that state, this is a convenient way to have an activity restart itself with a new configuration.

In some special cases, you may want to bypass restarting of your activity based on one or more types of configuration changes. This is done with the android.R.attr#configChanges android:configChanges attribute in its manifest. For any types of configuration changes you say that you handle there, you will receive a call to your current activity's #onConfigurationChanged method instead of being restarted. If a configuration change involves any that you do not handle, however, the activity will still be restarted and #onConfigurationChanged will not be called.

"StartingActivities"><h3>Starting Activities and Getting Results</h3>

The android.app.Activity#startActivity method is used to start a new activity, which will be placed at the top of the activity stack. It takes a single argument, an android.content.Intent Intent, which describes the activity to be executed.

Sometimes you want to get a result back from an activity when it ends. For example, you may start an activity that lets the user pick a person in a list of contacts; when it ends, it returns the person that was selected. To do this, you call the android.app.Activity#startActivityForResult(Intent, int) version with a second integer parameter identifying the call. The result will come back through your android.app.Activity#onActivityResult method.

When an activity exits, it can call android.app.Activity#setResult(int) to return data back to its parent. It must always supply a result code, which can be the standard results RESULT_CANCELED, RESULT_OK, or any custom values starting at RESULT_FIRST_USER. In addition, it can optionally return back an Intent containing any additional data it wants. All of this information appears back on the parent's Activity.onActivityResult(), along with the integer identifier it originally supplied.

If a child activity fails for any reason (such as crashing), the parent activity will receive a result with the code RESULT_CANCELED.

public class MyActivity extends Activity {
                ...

                static final int PICK_CONTACT_REQUEST = 0;

                public boolean onKeyDown(int keyCode, KeyEvent event) {
                    if (keyCode == KeyEvent.KEYCODE_DPAD_CENTER) {
                        // When the user center presses, let them pick a contact.
                        startActivityForResult(
                            new Intent(Intent.ACTION_PICK,
                            new Uri("content://contacts")),
                            PICK_CONTACT_REQUEST);
                       return true;
                    }
                    return false;
                }

                protected void onActivityResult(int requestCode, int resultCode,
                        Intent data) {
                    if (requestCode == PICK_CONTACT_REQUEST) {
                        if (resultCode == RESULT_OK) {
                            // A contact was picked.  Here we will just display it
                            // to the user.
                            startActivity(new Intent(Intent.ACTION_VIEW, data));
                        }
                    }
                }
            }

"SavingPersistentState"><h3>Saving Persistent State</h3>

There are generally two kinds of persistent state that an activity will deal with: shared document-like data (typically stored in a SQLite database using a android.content.ContentProvider content provider) and internal state such as user preferences.

For content provider data, we suggest that activities use an "edit in place" user model. That is, any edits a user makes are effectively made immediately without requiring an additional confirmation step. Supporting this model is generally a simple matter of following two rules:

<ul> <li>

When creating a new document, the backing database entry or file for it is created immediately. For example, if the user chooses to write a new email, a new entry for that email is created as soon as they start entering data, so that if they go to any other activity after that point this email will now appear in the list of drafts.

<li>

When an activity's onPause() method is called, it should commit to the backing content provider or file any changes the user has made. This ensures that those changes will be seen by any other activity that is about to run. You will probably want to commit your data even more aggressively at key times during your activity's lifecycle: for example before starting a new activity, before finishing your own activity, when the user switches between input fields, etc.

</ul>

This model is designed to prevent data loss when a user is navigating between activities, and allows the system to safely kill an activity (because system resources are needed somewhere else) at any time after it has been stopped (or paused on platform versions before android.os.Build.VERSION_CODES#HONEYCOMB). Note this implies that the user pressing BACK from your activity does <em>not</em> mean "cancel" -- it means to leave the activity with its current contents saved away. Canceling edits in an activity must be provided through some other mechanism, such as an explicit "revert" or "undo" option.

See the android.content.ContentProvider content package for more information about content providers. These are a key aspect of how different activities invoke and propagate data between themselves.

The Activity class also provides an API for managing internal persistent state associated with an activity. This can be used, for example, to remember the user's preferred initial display in a calendar (day view or week view) or the user's default home page in a web browser.

Activity persistent state is managed with the method #getPreferences, allowing you to retrieve and modify a set of name/value pairs associated with the activity. To use preferences that are shared across multiple application components (activities, receivers, services, providers), you can use the underlying Context#getSharedPreferences Context.getSharedPreferences() method to retrieve a preferences object stored under a specific name. (Note that it is not possible to share settings data across application packages -- for that you will need a content provider.)

Here is an excerpt from a calendar activity that stores the user's preferred view mode in its persistent settings:

public class CalendarActivity extends Activity {
                ...

                static final int DAY_VIEW_MODE = 0;
                static final int WEEK_VIEW_MODE = 1;

                private SharedPreferences mPrefs;
                private int mCurViewMode;

                protected void onCreate(Bundle savedInstanceState) {
                    super.onCreate(savedInstanceState);

                    mPrefs = getSharedPreferences(getLocalClassName(), MODE_PRIVATE);
                    mCurViewMode = mPrefs.getInt("view_mode", DAY_VIEW_MODE);
                }

                protected void onPause() {
                    super.onPause();

                    SharedPreferences.Editor ed = mPrefs.edit();
                    ed.putInt("view_mode", mCurViewMode);
                    ed.commit();
                }
            }

"Permissions"><h3>Permissions</h3>

The ability to start a particular Activity can be enforced when it is declared in its manifest's android.R.styleable#AndroidManifestActivity &lt;activity&gt; tag. By doing so, other applications will need to declare a corresponding android.R.styleable#AndroidManifestUsesPermission &lt;uses-permission&gt; element in their own manifest to be able to start that activity.

When starting an Activity you can set Intent#FLAG_GRANT_READ_URI_PERMISSION Intent.FLAG_GRANT_READ_URI_PERMISSION and/or Intent#FLAG_GRANT_WRITE_URI_PERMISSION Intent.FLAG_GRANT_WRITE_URI_PERMISSION on the Intent. This will grant the Activity access to the specific URIs in the Intent. Access will remain until the Activity has finished (it will remain across the hosting process being killed and other temporary destruction). As of android.os.Build.VERSION_CODES#GINGERBREAD, if the Activity was already created and a new Intent is being delivered to #onNewIntent(Intent), any newly granted URI permissions will be added to the existing ones it holds.

See the Security and Permissions document for more information on permissions and security in general.

"ProcessLifecycle"><h3>Process Lifecycle</h3>

The Android system attempts to keep an application process around for as long as possible, but eventually will need to remove old processes when memory runs low. As described in Activity Lifecycle, the decision about which process to remove is intimately tied to the state of the user's interaction with it. In general, there are four states a process can be in based on the activities running in it, listed here in order of importance. The system will kill less important processes (the last ones) before it resorts to killing more important processes (the first ones).

<ol> <li>

The <b>foreground activity</b> (the activity at the top of the screen that the user is currently interacting with) is considered the most important. Its process will only be killed as a last resort, if it uses more memory than is available on the device. Generally at this point the device has reached a memory paging state, so this is required in order to keep the user interface responsive. <li>

A <b>visible activity</b> (an activity that is visible to the user but not in the foreground, such as one sitting behind a foreground dialog or next to other activities in multi-window mode) is considered extremely important and will not be killed unless that is required to keep the foreground activity running. <li>

A <b>background activity</b> (an activity that is not visible to the user and has been stopped) is no longer critical, so the system may safely kill its process to reclaim memory for other foreground or visible processes. If its process needs to be killed, when the user navigates back to the activity (making it visible on the screen again), its #onCreate method will be called with the savedInstanceState it had previously supplied in #onSaveInstanceState so that it can restart itself in the same state as the user last left it. <li>

An <b>empty process</b> is one hosting no activities or other application components (such as Service or android.content.BroadcastReceiver classes). These are killed very quickly by the system as memory becomes low. For this reason, any background operation you do outside of an activity must be executed in the context of an activity BroadcastReceiver or Service to ensure that the system knows it needs to keep your process around. </ol>

Sometimes an Activity may need to do a long-running operation that exists independently of the activity lifecycle itself. An example may be a camera application that allows you to upload a picture to a web site. The upload may take a long time, and the application should allow the user to leave the application while it is executing. To accomplish this, your Activity should start a Service in which the upload takes place. This allows the system to properly prioritize your process (considering it to be more important than other non-visible applications) for the duration of the upload, independent of whether the original activity is paused, stopped, or finished.

Java documentation for android.app.Activity.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

Activity()
Activity(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

Fields

AccessibilityService

Use with #getSystemService(String) to retrieve a android.view.accessibility.AccessibilityManager for giving the user feedback for UI events through the registered event listeners.

(Inherited from Context)
AccountService

Use with #getSystemService(String) to retrieve a android.accounts.AccountManager for receiving intents at a time of your choosing.

(Inherited from Context)
ActivityService

Use with #getSystemService(String) to retrieve a android.app.ActivityManager for interacting with the global system state.

(Inherited from Context)
AlarmService

Use with #getSystemService(String) to retrieve a android.app.AlarmManager for receiving intents at a time of your choosing.

(Inherited from Context)
AppOpsService

Use with #getSystemService(String) to retrieve a android.app.AppOpsManager for tracking application operations on the device.

(Inherited from Context)
AppSearchService

Use with #getSystemService(String) to retrieve an android.app.appsearch.AppSearchManager for indexing and querying app data managed by the system.

(Inherited from Context)
AppwidgetService

Use with #getSystemService(String) to retrieve a android.appwidget.AppWidgetManager for accessing AppWidgets.

(Inherited from Context)
AudioService

Use with #getSystemService(String) to retrieve a android.media.AudioManager for handling management of volume, ringer modes and audio routing.

(Inherited from Context)
BatteryService

Use with #getSystemService(String) to retrieve a android.os.BatteryManager for managing battery state.

(Inherited from Context)
BindAllowActivityStarts
Obsolete.

Flag for #bindService: If binding from an app that is visible, the bound service is allowed to start an activity from background.

(Inherited from Context)
BindExternalServiceLong

Works in the same way as #BIND_EXTERNAL_SERVICE, but it's defined as a (

(Inherited from Context)
BindNotPerceptible
Obsolete.

Flag for #bindService: If binding from an app that is visible or user-perceptible, lower the target service's importance to below the perceptible level.

(Inherited from Context)
BindSharedIsolatedProcess
Obsolete.

Flag for #bindIsolatedService: Bind the service into a shared isolated process.

(Inherited from Context)
BiometricService

Use with #getSystemService(String) to retrieve a android.hardware.biometrics.BiometricManager for handling biometric and PIN/pattern/password authentication.

(Inherited from Context)
BlobStoreService

Use with #getSystemService(String) to retrieve a android.app.blob.BlobStoreManager for contributing and accessing data blobs from the blob store maintained by the system.

(Inherited from Context)
BluetoothService

Use with #getSystemService(String) to retrieve a android.bluetooth.BluetoothManager for using Bluetooth.

(Inherited from Context)
BugreportService

Service to capture a bugreport.

(Inherited from Context)
CameraService

Use with #getSystemService(String) to retrieve a android.hardware.camera2.CameraManager for interacting with camera devices.

(Inherited from Context)
CaptioningService

Use with #getSystemService(String) to retrieve a android.view.accessibility.CaptioningManager for obtaining captioning properties and listening for changes in captioning preferences.

(Inherited from Context)
CarrierConfigService

Use with #getSystemService(String) to retrieve a android.telephony.CarrierConfigManager for reading carrier configuration values.

(Inherited from Context)
ClipboardService

Use with #getSystemService(String) to retrieve a android.content.ClipboardManager for accessing and modifying the contents of the global clipboard.

(Inherited from Context)
CompanionDeviceService

Use with #getSystemService(String) to retrieve a android.companion.CompanionDeviceManager for managing companion devices

(Inherited from Context)
ConnectivityDiagnosticsService

Use with #getSystemService(String) to retrieve a android.net.ConnectivityDiagnosticsManager for performing network connectivity diagnostics as well as receiving network connectivity information from the system.

(Inherited from Context)
ConnectivityService

Use with #getSystemService(String) to retrieve a android.net.ConnectivityManager for handling management of network connections.

(Inherited from Context)
ConsumerIrService

Use with #getSystemService(String) to retrieve a android.hardware.ConsumerIrManager for transmitting infrared signals from the device.

(Inherited from Context)
CredentialService

Use with #getSystemService(String) to retrieve a android.credentials.CredentialManager to authenticate a user to your app.

(Inherited from Context)
CrossProfileAppsService

Use with #getSystemService(String) to retrieve a android.content.pm.CrossProfileApps for cross profile operations.

(Inherited from Context)
DeviceIdDefault

The default device ID, which is the ID of the primary (non-virtual) device.

(Inherited from Context)
DeviceIdInvalid

Invalid device ID.

(Inherited from Context)
DeviceLockService

Use with #getSystemService(String) to retrieve a android.devicelock.DeviceLockManager.

(Inherited from Context)
DevicePolicyService

Use with #getSystemService(String) to retrieve a android.app.admin.DevicePolicyManager for working with global device policy management.

(Inherited from Context)
DisplayHashService

Use with #getSystemService(String) to access android.view.displayhash.DisplayHashManager to handle display hashes.

(Inherited from Context)
DisplayService

Use with #getSystemService(String) to retrieve a android.hardware.display.DisplayManager for interacting with display devices.

(Inherited from Context)
DomainVerificationService

Use with #getSystemService(String) to access android.content.pm.verify.domain.DomainVerificationManager to retrieve approval and user state for declared web domains.

(Inherited from Context)
DownloadService

Use with #getSystemService(String) to retrieve a android.app.DownloadManager for requesting HTTP downloads.

(Inherited from Context)
DropboxService

Use with #getSystemService(String) to retrieve a android.os.DropBoxManager instance for recording diagnostic logs.

(Inherited from Context)
EuiccService

Use with #getSystemService(String) to retrieve a android.telephony.euicc.EuiccManager to manage the device eUICC (embedded SIM).

(Inherited from Context)
FileIntegrityService

Use with #getSystemService(String) to retrieve an android.security.FileIntegrityManager.

(Inherited from Context)
FingerprintService

Use with #getSystemService(String) to retrieve a android.hardware.fingerprint.FingerprintManager for handling management of fingerprints.

(Inherited from Context)
FullscreenModeRequestEnter
Obsolete.

Request type of #requestFullscreenMode(int, OutcomeReceiver), to request enter fullscreen mode from multi-window mode.

FullscreenModeRequestExit
Obsolete.

Request type of #requestFullscreenMode(int, OutcomeReceiver), to request exiting the requested fullscreen mode and restore to the previous multi-window mode.

GameService

Use with #getSystemService(String) to retrieve a GameManager.

(Inherited from Context)
GrammaticalInflectionService

Use with #getSystemService(String) to retrieve a GrammaticalInflectionManager.

(Inherited from Context)
HardwarePropertiesService

Use with #getSystemService(String) to retrieve a android.os.HardwarePropertiesManager for accessing the hardware properties service.

(Inherited from Context)
HealthconnectService

Use with #getSystemService(String) to retrieve a android.health.connect.HealthConnectManager.

(Inherited from Context)
InputMethodService

Use with #getSystemService(String) to retrieve a android.view.inputmethod.InputMethodManager for accessing input methods.

(Inherited from Context)
InputService

Use with #getSystemService(String) to retrieve a android.hardware.input.InputManager for interacting with input devices.

(Inherited from Context)
IpsecService

Use with #getSystemService(String) to retrieve a android.net.IpSecManager for encrypting Sockets or Networks with IPSec.

(Inherited from Context)
JobSchedulerService

Use with #getSystemService(String) to retrieve a android.app.job.JobScheduler instance for managing occasional background tasks.

(Inherited from Context)
KeyguardService

Use with #getSystemService(String) to retrieve a android.app.KeyguardManager for controlling keyguard.

(Inherited from Context)
LauncherAppsService

Use with #getSystemService(String) to retrieve a android.content.pm.LauncherApps for querying and monitoring launchable apps across profiles of a user.

(Inherited from Context)
LayoutInflaterService

Use with #getSystemService(String) to retrieve a android.view.LayoutInflater for inflating layout resources in this context.

(Inherited from Context)
LocaleService

Use with #getSystemService(String) to retrieve a android.app.LocaleManager.

(Inherited from Context)
LocationService

Use with #getSystemService(String) to retrieve a android.location.LocationManager for controlling location updates.

(Inherited from Context)
MediaCommunicationService

Use with #getSystemService(String) to retrieve a android.media.MediaCommunicationManager for managing android.media.MediaSession2.

(Inherited from Context)
MediaMetricsService

Use with #getSystemService(String) to retrieve a android.media.metrics.MediaMetricsManager for interacting with media metrics on the device.

(Inherited from Context)
MediaProjectionService

Use with #getSystemService(String) to retrieve a android.media.projection.MediaProjectionManager instance for managing media projection sessions.

(Inherited from Context)
MediaRouterService

Use with #getSystemService to retrieve a android.media.MediaRouter for controlling and managing routing of media.

(Inherited from Context)
MediaSessionService

Use with #getSystemService(String) to retrieve a android.media.session.MediaSessionManager for managing media Sessions.

(Inherited from Context)
MidiService

Use with #getSystemService(String) to retrieve a android.media.midi.MidiManager for accessing the MIDI service.

(Inherited from Context)
NetworkStatsService

Use with #getSystemService(String) to retrieve a android.app.usage.NetworkStatsManager for querying network usage stats.

(Inherited from Context)
NfcService

Use with #getSystemService(String) to retrieve a android.nfc.NfcManager for using NFC.

(Inherited from Context)
NotificationService

Use with #getSystemService(String) to retrieve a android.app.NotificationManager for informing the user of background events.

(Inherited from Context)
NsdService

Use with #getSystemService(String) to retrieve a android.net.nsd.NsdManager for handling management of network service discovery

(Inherited from Context)
OverlayService

Use with #getSystemService(String) to retrieve a android.content.om.OverlayManager for managing overlay packages.

(Inherited from Context)
OverrideTransitionClose
Obsolete.

Request type of #overrideActivityTransition(int, int, int) or #overrideActivityTransition(int, int, int, int), to override the closing transition.

OverrideTransitionOpen
Obsolete.

Request type of #overrideActivityTransition(int, int, int) or #overrideActivityTransition(int, int, int, int), to override the opening transition.

PeopleService

Use with #getSystemService(String) to access a PeopleManager to interact with your published conversations.

(Inherited from Context)
PerformanceHintService

Use with #getSystemService(String) to retrieve a android.os.PerformanceHintManager for accessing the performance hinting service.

(Inherited from Context)
PowerService

Use with #getSystemService(String) to retrieve a android.os.PowerManager for controlling power management, including "wake locks," which let you keep the device on while you're running long tasks.

(Inherited from Context)
PrintService

android.print.PrintManager for printing and managing printers and print tasks.

(Inherited from Context)
ReceiverExported
Obsolete.

Flag for #registerReceiver: The receiver can receive broadcasts from other Apps.

(Inherited from Context)
ReceiverNotExported
Obsolete.

Flag for #registerReceiver: The receiver cannot receive broadcasts from other Apps.

(Inherited from Context)
ReceiverVisibleToInstantApps
Obsolete.

Flag for #registerReceiver: The receiver can receive broadcasts from Instant Apps.

(Inherited from Context)
RestrictionsService

Use with #getSystemService(String) to retrieve a android.content.RestrictionsManager for retrieving application restrictions and requesting permissions for restricted operations.

(Inherited from Context)
RoleService

Use with #getSystemService(String) to retrieve a android.app.role.RoleManager for managing roles.

(Inherited from Context)
SearchService

Use with #getSystemService(String) to retrieve a android.app.SearchManager for handling searches.

(Inherited from Context)
SensorService

Use with #getSystemService(String) to retrieve a android.hardware.SensorManager for accessing sensors.

(Inherited from Context)
ShortcutService

Use with #getSystemService(String) to retrieve a android.content.pm.ShortcutManager for accessing the launcher shortcut service.

(Inherited from Context)
StatusBarService

Use with #getSystemService(String) to retrieve a android.app.StatusBarManager for interacting with the status bar and quick settings.

(Inherited from Context)
StorageService

Use with #getSystemService(String) to retrieve a android.os.storage.StorageManager for accessing system storage functions.

(Inherited from Context)
StorageStatsService

Use with #getSystemService(String) to retrieve a android.app.usage.StorageStatsManager for accessing system storage statistics.

(Inherited from Context)
SystemHealthService

Use with #getSystemService(String) to retrieve a android.os.health.SystemHealthManager for accessing system health (battery, power, memory, etc) metrics.

(Inherited from Context)
TelecomService

Use with #getSystemService(String) to retrieve a android.telecom.TelecomManager to manage telecom-related features of the device.

(Inherited from Context)
TelephonyImsService

Use with #getSystemService(String) to retrieve an android.telephony.ims.ImsManager.

(Inherited from Context)
TelephonyService

Use with #getSystemService(String) to retrieve a android.telephony.TelephonyManager for handling management the telephony features of the device.

(Inherited from Context)
TelephonySubscriptionService

Use with #getSystemService(String) to retrieve a android.telephony.SubscriptionManager for handling management the telephony subscriptions of the device.

(Inherited from Context)
TextClassificationService

Use with #getSystemService(String) to retrieve a TextClassificationManager for text classification services.

(Inherited from Context)
TextServicesManagerService

Use with #getSystemService(String) to retrieve a android.view.textservice.TextServicesManager for accessing text services.

(Inherited from Context)
TvInputService

Use with #getSystemService(String) to retrieve a android.media.tv.TvInputManager for interacting with TV inputs on the device.

(Inherited from Context)
TvInteractiveAppService

Use with #getSystemService(String) to retrieve a android.media.tv.interactive.TvInteractiveAppManager for interacting with TV interactive applications on the device.

(Inherited from Context)
UiModeService

Use with #getSystemService(String) to retrieve a android.app.UiModeManager for controlling UI modes.

(Inherited from Context)
UsageStatsService

Use with #getSystemService(String) to retrieve a android.app.usage.UsageStatsManager for querying device usage stats.

(Inherited from Context)
UsbService

Use with #getSystemService(String) to retrieve a android.hardware.usb.UsbManager for access to USB devices (as a USB host) and for controlling this device's behavior as a USB device.

(Inherited from Context)
UserService

Use with #getSystemService(String) to retrieve a android.os.UserManager for managing users on devices that support multiple users.

(Inherited from Context)
VibratorManagerService

Use with #getSystemService(String) to retrieve a android.os.VibratorManager for accessing the device vibrators, interacting with individual ones and playing synchronized effects on multiple vibrators.

(Inherited from Context)
VibratorService

Use with #getSystemService(String) to retrieve a android.os.Vibrator for interacting with the vibration hardware.

(Inherited from Context)
VirtualDeviceService

Use with #getSystemService(String) to retrieve a android.companion.virtual.VirtualDeviceManager for managing virtual devices.

(Inherited from Context)
VpnManagementService

Use with #getSystemService(String) to retrieve a android.net.VpnManager to manage profiles for the platform built-in VPN.

(Inherited from Context)
WallpaperService

Use with #getSystemService(String) to retrieve a com.

(Inherited from Context)
WifiAwareService

Use with #getSystemService(String) to retrieve a android.net.wifi.aware.WifiAwareManager for handling management of Wi-Fi Aware.

(Inherited from Context)
WifiP2pService

Use with #getSystemService(String) to retrieve a android.net.wifi.p2p.WifiP2pManager for handling management of Wi-Fi peer-to-peer connections.

(Inherited from Context)
WifiRttRangingService

Use with #getSystemService(String) to retrieve a android.net.wifi.rtt.WifiRttManager for ranging devices with wifi.

(Inherited from Context)
WifiService

Use with #getSystemService(String) to retrieve a android.net.wifi.WifiManager for handling management of Wi-Fi access.

(Inherited from Context)
WindowService

Use with #getSystemService(String) to retrieve a android.view.WindowManager for accessing the system's window manager.

(Inherited from Context)

Properties

ActionBar

Retrieve a reference to this activity's ActionBar.

Application

Return the application that owns this activity.

ApplicationContext

Return the context of the single, global Application object of the current process.

(Inherited from ContextWrapper)
ApplicationInfo

Return the full application info for this context's package.

(Inherited from ContextWrapper)
Assets

Return an AssetManager instance for your application's package.

(Inherited from ContextWrapper)
AttributionSource (Inherited from Context)
AttributionTag

Attribution can be used in complex apps to logically separate parts of the app.

(Inherited from Context)
BaseContext (Inherited from ContextWrapper)
CacheDir

Returns the absolute path to the application specific cache directory on the filesystem.

(Inherited from ContextWrapper)
CallingActivity

Return the name of the activity that invoked this activity.

CallingPackage

Return the name of the package that invoked this activity.

ChangingConfigurations

If this activity is being destroyed because it can not handle a configuration parameter being changed (and thus its #onConfigurationChanged(Configuration) method is <em>not</em> being called), then you can use this method to discover the set of changes that have occurred while in the process of being destroyed.

Class

Returns the runtime class of this Object.

(Inherited from Object)
ClassLoader

Return a class loader you can use to retrieve classes in this package.

(Inherited from ContextWrapper)
CodeCacheDir

Returns the absolute path to the application specific cache directory on the filesystem designed for storing cached code.

(Inherited from ContextWrapper)
ComponentName

Returns the complete component name of this activity.

ContentResolver

Return a ContentResolver instance for your application's package.

(Inherited from ContextWrapper)
ContentScene

Retrieve the Scene representing this window's current content.

ContentTransitionManager

Retrieve the TransitionManager responsible for default transitions in this window. -or- Set the TransitionManager to use for default transitions in this window.

CurrentFocus

Calls android.view.Window#getCurrentFocus on the Window of this Activity to return the currently focused view.

DataDir (Inherited from ContextWrapper)
DeviceId

Gets the device ID this context is associated with.

(Inherited from Context)
Display

Get the display this context is associated with.

(Inherited from Context)
ExternalCacheDir

Returns the absolute path to the directory on the primary external filesystem (that is somewhere on ExternalStorageDirectory where the application can place cache files it owns.

(Inherited from ContextWrapper)
FilesDir

Returns the absolute path to the directory on the filesystem where files created with OpenFileOutput(String, FileCreationMode) are stored.

(Inherited from ContextWrapper)
FocusedStateSet
FragmentManager

Return the FragmentManager for interacting with fragments associated with this activity.

Handle

The handle to the underlying Android instance.

(Inherited from Object)
HasWindowFocus

Returns true if this activity's <em>main</em> window currently has window focus.

Immersive

Bit indicating that this activity is "immersive" and should not be interrupted by notifications if possible. -or- Adjust the current immersive mode setting.

InstanceCount
Intent

Return the intent that started this activity. -or- Change the intent returned by #getIntent.

IsActivityTransitionRunning

Returns whether there are any activity transitions currently running on this activity.

IsChangingConfigurations

Check to see whether this activity is in the process of being destroyed in order to be recreated with a new configuration.

IsChild

Is this activity embedded inside of another activity?

IsDestroyed

Returns true if the final #onDestroy() call has been made on the Activity, so this instance is now dead.

IsDeviceProtectedStorage (Inherited from ContextWrapper)
IsFinishing

Check to see whether this activity is in the process of finishing, either because you called #finish on it or someone else has requested that it finished.

IsInMultiWindowMode

Returns true if the activity is currently in multi-window mode.

IsInPictureInPictureMode

Returns true if the activity is currently in picture-in-picture mode.

IsLaunchedFromBubble

Indicates whether this activity is launched from a bubble.

IsLocalVoiceInteractionSupported

Queries whether the currently enabled voice interaction service supports returning a voice interactor for use by the activity.

IsRestricted

Indicates whether this Context is restricted.

(Inherited from Context)
IsTaskRoot

Return whether this activity is the root of a task.

IsUiContext

Returns true if the context is a UI context which can access UI components such as WindowManager, android.view.LayoutInflater LayoutInflater or android.app.WallpaperManager WallpaperManager.

(Inherited from Context)
IsVoiceInteraction

Check whether this activity is running as part of a voice interaction with the user.

IsVoiceInteractionRoot

Like #isVoiceInteraction, but only returns true if this is also the root of a voice interaction.

JniIdentityHashCode (Inherited from Object)
JniPeerMembers
LastNonConfigurationInstance

Retrieve the non-configuration instance data that was previously returned by #onRetainNonConfigurationInstance().

LaunchedFromPackage

Returns the package name of the app that initially launched this activity.

LaunchedFromUid

Returns the uid of the app that initially launched this activity.

LayoutInflater

Convenience for calling android.view.Window#getLayoutInflater.

LoaderManager

Return the LoaderManager for this activity, creating it if needed.

LocalClassName

Returns class name for this activity with the package prefix removed.

MainExecutor

Return an Executor that will run enqueued tasks on the main thread associated with this context.

(Inherited from Context)
MainLooper

Return the Looper for the main thread of the current process.

(Inherited from ContextWrapper)
MaxNumPictureInPictureActions

Return the number of actions that will be displayed in the picture-in-picture UI when the user interacts with the activity currently in picture-in-picture mode.

MediaController

Gets the controller which should be receiving media key and volume events while this activity is in the foreground. -or- Sets a MediaController to send media keys and volume changes to.

MenuInflater

Returns a MenuInflater with this context.

NoBackupFilesDir

Returns the absolute path to the directory on the filesystem similar to FilesDir.

(Inherited from ContextWrapper)
ObbDir

Return the primary external storage directory where this application's OBB files (if there are any) can be found.

(Inherited from ContextWrapper)
OnBackInvokedDispatcher

Returns the OnBackInvokedDispatcher instance associated with the window that this activity is attached to.

OpPackageName

Return the package name that should be used for android.app.AppOpsManager calls from this context, so that app ops manager's uid verification will work with the name.

(Inherited from Context)
PackageCodePath

Return the full path to this context's primary Android package.

(Inherited from ContextWrapper)
PackageManager

Return PackageManager instance to find global package information.

(Inherited from ContextWrapper)
PackageName

Return the name of this application's package.

(Inherited from ContextWrapper)
PackageResourcePath

Return the full path to this context's primary Android package.

(Inherited from ContextWrapper)
Params

Return the set of parameters which this Context was created with, if it was created via #createContext(ContextParams).

(Inherited from Context)
Parent

Return the parent activity if this view is an embedded child.

ParentActivityIntent

Obtain an Intent that will launch an explicit target activity specified by this activity's logical parent.

PeerReference (Inherited from Object)
Referrer

Return information about who launched this activity.

RequestedOrientation

Return the current requested orientation of the activity. -or- Change the desired orientation of this activity.

Resources

Return a Resources instance for your application's package.

(Inherited from ContextWrapper)
SearchEvent

During the onSearchRequested() callbacks, this function will return the SearchEvent that triggered the callback, if it exists.

SplashScreen

Get the interface that activity use to talk to the splash screen.

TaskId

Return the identifier of the task this activity is in.

Theme

Return the Theme object associated with this Context.

(Inherited from ContextWrapper)
ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Title
TitleColor
Obsolete.

Change the color of the title associated with this activity.

TitleFormatted

Change the title associated with this activity.

VoiceInteractor

Retrieve the active VoiceInteractor that the user is going through to interact with this activity.

VolumeControlStream

Gets the suggested audio stream whose volume should be changed by the hardware volume controls. -or- Suggests an audio stream whose volume should be changed by the hardware volume controls.

Wallpaper (Inherited from ContextWrapper)
WallpaperDesiredMinimumHeight (Inherited from ContextWrapper)
WallpaperDesiredMinimumWidth (Inherited from ContextWrapper)
Window

Retrieve the current android.view.Window for the activity.

WindowManager

Retrieve the window manager for showing custom windows.

Methods

AddContentView(View, ViewGroup+LayoutParams)

Add an additional content view to the activity.

ApplyOverrideConfiguration(Configuration)

Call to set an "override configuration" on this context -- this is a configuration that replies one or more values of the standard configuration that is applied to the context.

(Inherited from ContextThemeWrapper)
AttachBaseContext(Context)

Set the base context for this ContextWrapper.

(Inherited from ContextWrapper)
BindService(Intent, Bind, IExecutor, IServiceConnection)

Same as #bindService(Intent, ServiceConnection, int) bindService(Intent, ServiceConnection, int) with executor to control ServiceConnection callbacks.

(Inherited from Context)
BindService(Intent, Context+BindServiceFlags, IExecutor, IServiceConnection) (Inherited from Context)
BindService(Intent, IServiceConnection, Bind)

Connect to an application service, creating it if needed.

(Inherited from ContextWrapper)
BindService(Intent, IServiceConnection, Context+BindServiceFlags) (Inherited from Context)
BindServiceAsUser(Intent, IServiceConnection, Context+BindServiceFlags, UserHandle) (Inherited from Context)
BindServiceAsUser(Intent, IServiceConnection, Int32, UserHandle)

Binds to a service in the given user in the same manner as #bindService.

(Inherited from Context)
CheckCallingOrSelfPermission(String)

Determine whether the calling process of an IPC or you have been granted a particular permission.

(Inherited from ContextWrapper)
CheckCallingOrSelfUriPermission(Uri, ActivityFlags)

Determine whether the calling process of an IPC or you has been granted permission to access a specific URI.

(Inherited from ContextWrapper)
CheckCallingOrSelfUriPermissions(IList<Uri>, Int32)

Determine whether the calling process of an IPC <em>or you</em> has been granted permission to access a list of URIs.

(Inherited from Context)
CheckCallingPermission(String)

Determine whether the calling process of an IPC you are handling has been granted a particular permission.

(Inherited from ContextWrapper)
CheckCallingUriPermission(Uri, ActivityFlags)

Determine whether the calling process and user ID has been granted permission to access a specific URI.

(Inherited from ContextWrapper)
CheckCallingUriPermissions(IList<Uri>, Int32)

Determine whether the calling process and user ID has been granted permission to access a list of URIs.

(Inherited from Context)
CheckPermission(String, Int32, Int32)

Determine whether the given permission is allowed for a particular process and user ID running in the system.

(Inherited from ContextWrapper)
CheckSelfPermission(String) (Inherited from ContextWrapper)
CheckUriPermission(Uri, Int32, Int32, ActivityFlags)

Determine whether a particular process and user ID has been granted permission to access a specific URI.

(Inherited from ContextWrapper)
CheckUriPermission(Uri, String, String, Int32, Int32, ActivityFlags)

Check both a Uri and normal permission.

(Inherited from ContextWrapper)
CheckUriPermissions(IList<Uri>, Int32, Int32, Int32)

Determine whether a particular process and user ID has been granted permission to access a list of URIs.

(Inherited from Context)
ClearOverrideActivityTransition(OverrideTransition)

Clears the animations which are set from #overrideActivityTransition.

ClearWallpaper()
Obsolete.
(Inherited from ContextWrapper)
Clone()

Creates and returns a copy of this object.

(Inherited from Object)
CloseContextMenu()

Programmatically closes the most recently opened context menu, if showing.

CloseOptionsMenu()

Progammatically closes the options menu.

CreateAttributionContext(String)

Return a new Context object for the current Context but attribute to a different tag.

(Inherited from Context)
CreateConfigurationContext(Configuration)

Return a new Context object for the current Context but whose resources are adjusted to match the given Configuration.

(Inherited from ContextWrapper)
CreateContext(ContextParams)

Creates a context with specific properties and behaviors.

(Inherited from Context)
CreateContextForSplit(String) (Inherited from ContextWrapper)
CreateDeviceContext(Int32)

Returns a new Context object from the current context but with device association given by the deviceId.

(Inherited from Context)
CreateDeviceProtectedStorageContext() (Inherited from ContextWrapper)
CreateDisplayContext(Display)

Return a new Context object for the current Context but whose resources are adjusted to match the metrics of the given Display.

(Inherited from ContextWrapper)
CreatePackageContext(String, PackageContextFlags)

Return a new Context object for the given application name.

(Inherited from ContextWrapper)
CreatePendingResult(Int32, Intent, PendingIntentFlags)

Create a new PendingIntent object which you can hand to others for them to use to send result data back to your #onActivityResult callback.

CreateWindowContext(Display, Int32, Bundle)

Creates a Context for a non-android.app.Activity activity window on the given Display.

(Inherited from Context)
CreateWindowContext(Int32, Bundle)

Creates a Context for a non-activity window.

(Inherited from Context)
DatabaseList()

Returns an array of strings naming the private databases associated with this Context's application package.

(Inherited from ContextWrapper)
DeleteDatabase(String)

Delete an existing private SQLiteDatabase associated with this Context's application package.

(Inherited from ContextWrapper)
DeleteFile(String)

Delete the given private file associated with this Context's application package.

(Inherited from ContextWrapper)
DeleteSharedPreferences(String) (Inherited from ContextWrapper)
DismissDialog(Int32)
Obsolete.

Dismiss a dialog that was previously shown via #showDialog(int).

DismissKeyboardShortcutsHelper()

Dismiss the Keyboard Shortcuts screen.

DispatchGenericMotionEvent(MotionEvent)

Called to process generic motion events.

DispatchKeyEvent(KeyEvent)

Called to process key events.

DispatchKeyShortcutEvent(KeyEvent)

Called to process a key shortcut event.

DispatchPopulateAccessibilityEvent(AccessibilityEvent)

Called to process population of AccessibilityEvents.

DispatchTouchEvent(MotionEvent)

Called to process touch screen events.

DispatchTrackballEvent(MotionEvent)

Called to process trackball events.

Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Dump(String, FileDescriptor, PrintWriter, String[])

Print the Activity's state into the given stream.

EnforceCallingOrSelfPermission(String, String)

If neither you nor the calling process of an IPC you are handling has been granted a particular permission, throw a SecurityException.

(Inherited from ContextWrapper)
EnforceCallingOrSelfUriPermission(Uri, ActivityFlags, String)

If the calling process of an IPC or you has not been granted permission to access a specific URI, throw SecurityException.

(Inherited from ContextWrapper)
EnforceCallingPermission(String, String)

If the calling process of an IPC you are handling has not been granted a particular permission, throw a SecurityException.

(Inherited from ContextWrapper)
EnforceCallingUriPermission(Uri, ActivityFlags, String)

If the calling process and user ID has not been granted permission to access a specific URI, throw SecurityException.

(Inherited from ContextWrapper)
EnforcePermission(String, Int32, Int32, String)

If the given permission is not allowed for a particular process and user ID running in the system, throw a SecurityException.

(Inherited from ContextWrapper)
EnforceUriPermission(Uri, Int32, Int32, ActivityFlags, String)

If a particular process and user ID has not been granted permission to access a specific URI, throw SecurityException.

(Inherited from ContextWrapper)
EnforceUriPermission(Uri, String, String, Int32, Int32, ActivityFlags, String)

Enforce both a Uri and normal permission.

(Inherited from ContextWrapper)
EnterPictureInPictureMode()

Puts the activity in picture-in-picture mode if possible in the current system state.

EnterPictureInPictureMode(PictureInPictureParams)

Puts the activity in picture-in-picture mode if possible in the current system state.

Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
FileList()

Returns an array of strings naming the private files associated with this Context's application package.

(Inherited from ContextWrapper)
FindViewById(Int32)

Finds a view that was identified by the android:id XML attribute that was processed in #onCreate.

FindViewById<T>(Int32)

Finds a view that was identified by the id attribute from the XML layout resource.

Finish()

Call this when your activity is done and should be closed.

FinishActivity(Int32)

Force finish another activity that you had previously started with #startActivityForResult.

FinishActivityFromChild(Activity, Int32)

This is called when a child activity of this one calls its finishActivity().

FinishAffinity()

Finish this activity as well as all activities immediately below it in the current task that have the same affinity.

FinishAfterTransition()

Reverses the Activity Scene entry Transition and triggers the calling Activity to reverse its exit Transition.

FinishAndRemoveTask()

Call this when your activity is done and should be closed and the task should be completely removed as a part of finishing the root activity of the task.

FinishFromChild(Activity)

This is called when a child activity of this one calls its #finish method.

GetColor(Int32)

Returns a color associated with a particular resource ID and styled for the current theme.

(Inherited from Context)
GetColorStateList(Int32)

Returns a color state list associated with a particular resource ID and styled for the current theme.

(Inherited from Context)
GetDatabasePath(String) (Inherited from ContextWrapper)
GetDir(String, FileCreationMode)

Retrieve, creating if needed, a new directory in which the application can place its own custom data files.

(Inherited from ContextWrapper)
GetDrawable(Int32)

Returns a drawable object associated with a particular resource ID and styled for the current theme.

(Inherited from Context)
GetExternalCacheDirs()

Returns absolute paths to application-specific directories on all external storage devices where the application can place cache files it owns.

(Inherited from ContextWrapper)
GetExternalFilesDir(String)

Returns the absolute path to the directory on the primary external filesystem (that is somewhere on ExternalStorageDirectory) where the application can place persistent files it owns.

(Inherited from ContextWrapper)
GetExternalFilesDirs(String)

Returns absolute paths to application-specific directories on all external storage devices where the application can place persistent files it owns.

(Inherited from ContextWrapper)
GetExternalMediaDirs()
Obsolete.

Returns absolute paths to application-specific directories on all external storage devices where the application can place media files.

(Inherited from ContextWrapper)
GetFileStreamPath(String)

Returns the absolute path on the filesystem where a file created with OpenFileOutput(String, FileCreationMode) is stored.

(Inherited from ContextWrapper)
GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
GetObbDirs()

Returns absolute paths to application-specific directories on all external storage devices where the application's OBB files (if there are any) can be found.

(Inherited from ContextWrapper)
GetPreferences(FileCreationMode)

Retrieve a SharedPreferences object for accessing preferences that are private to this activity.

GetSharedPreferences(String, FileCreationMode)

Retrieve and hold the contents of the preferences file 'name', returning a SharedPreferences through which you can retrieve and modify its values.

(Inherited from ContextWrapper)
GetString(Int32, Object[])

Returns a localized string from the application's package's default string table.

(Inherited from Context)
GetString(Int32)

Returns a localized string from the application's package's default string table.

(Inherited from Context)
GetSystemService(Class)

Return the handle to a system-level service by class.

(Inherited from Context)
GetSystemService(String)

Return the handle to a system-level service by name.

(Inherited from ContextWrapper)
GetSystemServiceName(Class) (Inherited from ContextWrapper)
GetText(Int32)

Return a localized, styled CharSequence from the application's package's default string table.

(Inherited from Context)
GetTextFormatted(Int32)

Return a localized, styled CharSequence from the application's package's default string table.

(Inherited from Context)
GrantUriPermission(String, Uri, ActivityFlags)

Grant permission to access a specific Uri to another package, regardless of whether that package has general permission to access the Uri's content provider.

(Inherited from ContextWrapper)
InvalidateOptionsMenu()

Declare that the options menu has changed, so should be recreated.

JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
ManagedQuery(Uri, String[], String, String[], String)
Obsolete.

Wrapper around ContentResolver#query(android.net.Uri , String[], String, String[], String) that gives the resulting Cursor to call #startManagingCursor so that the activity will manage its lifecycle for you.

MoveDatabaseFrom(Context, String) (Inherited from ContextWrapper)
MoveSharedPreferencesFrom(Context, String) (Inherited from ContextWrapper)
MoveTaskToBack(Boolean)

Move the task containing this activity to the back of the activity stack.

NavigateUpTo(Intent)

Navigate from this activity to the activity specified by upIntent, finishing this activity in the process.

NavigateUpToFromChild(Activity, Intent)

This is called when a child activity of this one calls its #navigateUpTo method.

Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
ObtainStyledAttributes(IAttributeSet, Int32[], Int32, Int32)

Retrieve styled attribute information in this Context's theme.

(Inherited from Context)
ObtainStyledAttributes(IAttributeSet, Int32[])

Retrieve styled attribute information in this Context's theme.

(Inherited from Context)
ObtainStyledAttributes(Int32, Int32[])

Retrieve styled attribute information in this Context's theme.

(Inherited from Context)
ObtainStyledAttributes(Int32[])

Retrieve styled attribute information in this Context's theme.

(Inherited from Context)
OnActionModeFinished(ActionMode)

Notifies the activity that an action mode has finished.

OnActionModeStarted(ActionMode)

Notifies the Activity that an action mode has been started.

OnActivityReenter(Int32, Intent)

Called when an activity you launched with an activity transition exposes this Activity through a returning activity transition, giving you the resultCode and any additional data from it.

OnActivityResult(Int32, Result, Intent)

Called when an activity you launched exits, giving you the requestCode you started it with, the resultCode it returned, and any additional data from it.

OnApplyThemeResource(Resources+Theme, Int32, Boolean)

Called by #setTheme and #getTheme to apply a theme resource to the current Theme object.

(Inherited from ContextThemeWrapper)
OnAttachedToWindow()

Called when the main window associated with the activity has been attached to the window manager.

OnAttachFragment(Fragment)

Called when a Fragment is being attached to this activity, immediately after the call to its Fragment#onAttach Fragment.onAttach() method and before Fragment#onCreate Fragment.onCreate().

OnBackPressed()

Called when the activity has detected the user's press of the back key.

OnChildTitleChanged(Activity, ICharSequence)
OnChildTitleChanged(Activity, String)
OnConfigurationChanged(Configuration)

Called by the system when the device configuration changes while your activity is running.

OnContentChanged()

This hook is called whenever the content view of the screen changes (due to a call to M:Android.Views.Window.SetContentView(Android.Views.View,.LayoutParams) or AddContentView(View, ViewGroup+LayoutParams)).

OnContextItemSelected(IMenuItem)

This hook is called whenever an item in a context menu is selected.

OnContextMenuClosed(IMenu)

This hook is called whenever the context menu is being closed (either by the user canceling the menu with the back/menu button, or when an item is selected).

OnCreate(Bundle, PersistableBundle)

Same as #onCreate(android.os.Bundle) but called for those activities created with the attribute android.R.attr#persistableMode set to persistAcrossReboots.

OnCreate(Bundle)

Called when the activity is starting.

OnCreateContextMenu(IContextMenu, View, IContextMenuContextMenuInfo)

Called when a context menu for the view is about to be shown.

OnCreateDescription()

Generate a new description for this activity.

OnCreateDescriptionFormatted()

Generate a new description for this activity.

OnCreateDialog(Int32, Bundle)
Obsolete.

Callback for creating dialogs that are managed (saved and restored) for you by the activity.

OnCreateDialog(Int32)
Obsolete.

This member is deprecated.

OnCreateNavigateUpTaskStack(TaskStackBuilder)

Define the synthetic task stack that will be generated during Up navigation from a different task.

OnCreateOptionsMenu(IMenu)

Initialize the contents of the Activity's standard options menu.

OnCreatePanelMenu(Int32, IMenu)

Default implementation of android.view.Window.Callback#onCreatePanelMenu for activities.

OnCreatePanelView(Int32)

Default implementation of android.view.Window.Callback#onCreatePanelView for activities.

OnCreateThumbnail(Bitmap, Canvas)

This member is deprecated.

OnCreateView(String, Context, IAttributeSet)

Standard implementation of android.view.LayoutInflater.Factory#onCreateView used when inflating with the LayoutInflater returned by #getSystemService.

OnCreateView(View, String, Context, IAttributeSet)

Standard implementation of android.view.LayoutInflater.Factory2#onCreateView(View, String, Context, AttributeSet) used when inflating with the LayoutInflater returned by #getSystemService.

OnDestroy()

Perform any final cleanup before an activity is destroyed.

OnDetachedFromWindow()

Called when the main window associated with the activity has been detached from the window manager.

OnEnterAnimationComplete()

Activities cannot draw during the period that their windows are animating in.

OnGenericMotionEvent(MotionEvent)

Called when a generic motion event was not handled by any of the views inside of the activity.

OnGetDirectActions(CancellationSignal, IConsumer)

Returns the list of direct actions supported by the app.

OnKeyDown(Keycode, KeyEvent)

Called when a key was pressed down and not handled by any of the views inside of the activity.

OnKeyLongPress(Keycode, KeyEvent)

Default implementation of KeyEvent.Callback#onKeyLongPress(int, KeyEvent) KeyEvent.Callback.onKeyLongPress(): always returns false (doesn't handle the event).

OnKeyMultiple(Keycode, Int32, KeyEvent)

Default implementation of KeyEvent.Callback#onKeyMultiple(int, int, KeyEvent) KeyEvent.Callback.onKeyMultiple(): always returns false (doesn't handle the event).

OnKeyShortcut(Keycode, KeyEvent)

Called when a key shortcut event is not handled by any of the views in the Activity.

OnKeyUp(Keycode, KeyEvent)

Called when a key was released and not handled by any of the views inside of the activity.

OnLocalVoiceInteractionStarted()

Callback to indicate that #startLocalVoiceInteraction(Bundle) has resulted in a voice interaction session being started.

OnLocalVoiceInteractionStopped()

Callback to indicate that the local voice interaction has stopped either because it was requested through a call to #stopLocalVoiceInteraction() or because it was canceled by the user.

OnLowMemory()

This is called when the overall system is running low on memory, and actively running processes should trim their memory usage.

OnMenuItemSelected(Int32, IMenuItem)

Default implementation of android.view.Window.Callback#onMenuItemSelected for activities.

OnMenuOpened(Int32, IMenu)

To be added

OnMultiWindowModeChanged(Boolean, Configuration)

Called by the system when the activity changes from fullscreen mode to multi-window mode and visa-versa.

OnMultiWindowModeChanged(Boolean)

Called by the system when the activity changes from fullscreen mode to multi-window mode and visa-versa.

OnNavigateUp()

This method is called whenever the user chooses to navigate Up within your application's activity hierarchy from the action bar.

OnNavigateUpFromChild(Activity)

This is called when a child activity of this one attempts to navigate up.

OnNewIntent(Intent)

This is called for activities that set launchMode to "singleTop" in their package, or if a client used the Intent#FLAG_ACTIVITY_SINGLE_TOP flag when calling #startActivity.

OnOptionsItemSelected(IMenuItem)

This hook is called whenever an item in your options menu is selected.

OnOptionsMenuClosed(IMenu)

This hook is called whenever the options menu is being closed (either by the user canceling the menu with the back/menu button, or when an item is selected).

OnPanelClosed(Int32, IMenu)

Default implementation of android.view.Window.Callback#onPanelClosed(int, Menu) for activities.

OnPause()

Called as part of the activity lifecycle when the user no longer actively interacts with the activity, but it is still visible on screen.

OnPerformDirectAction(String, Bundle, CancellationSignal, IConsumer)

This is called to perform an action previously defined by the app.

OnPictureInPictureModeChanged(Boolean, Configuration)

Called by the system when the activity changes to and from picture-in-picture mode.

OnPictureInPictureModeChanged(Boolean)

Called by the system when the activity changes to and from picture-in-picture mode.

OnPictureInPictureRequested()

This method is called by the system in various cases where picture in picture mode should be entered if supported.

OnPictureInPictureUiStateChanged(PictureInPictureUiState)

Called by the system when the activity is in PiP and has state changes.

OnPostCreate(Bundle, PersistableBundle)

This is the same as #onPostCreate(Bundle) but is called for activities created with the attribute android.R.attr#persistableMode set to persistAcrossReboots.

OnPostCreate(Bundle)

Called when activity start-up is complete (after #onStart and #onRestoreInstanceState have been called).

OnPostResume()

Called when activity resume is complete (after #onResume has been called).

OnPrepareDialog(Int32, Dialog, Bundle)
Obsolete.

Provides an opportunity to prepare a managed dialog before it is being shown.

OnPrepareDialog(Int32, Dialog)
Obsolete.

This member is deprecated.

OnPrepareNavigateUpTaskStack(TaskStackBuilder)

Prepare the synthetic task stack that will be generated during Up navigation from a different task.

OnPrepareOptionsMenu(IMenu)

Prepare the Screen's standard options menu to be displayed.

OnPreparePanel(Int32, View, IMenu)

Default implementation of android.view.Window.Callback#onPreparePanel for activities.

OnProvideAssistContent(AssistContent)

This is called when the user is requesting an assist, to provide references to content related to the current activity.

OnProvideAssistData(Bundle)

This is called when the user is requesting an assist, to build a full Intent#ACTION_ASSIST Intent with all of the context of the current application.

OnProvideKeyboardShortcuts(IList<KeyboardShortcutGroup>, IMenu, Int32)
OnProvideReferrer()

Override to generate the desired referrer for the content currently being shown by the app.

OnRequestPermissionsResult(Int32, String[], Permission[])

Callback for the result from requesting permissions.

OnRestart()

Called after #onStop when the current activity is being re-displayed to the user (the user has navigated back to it).

OnRestoreInstanceState(Bundle, PersistableBundle)

This is the same as #onRestoreInstanceState(Bundle) but is called for activities created with the attribute android.R.attr#persistableMode set to persistAcrossReboots.

OnRestoreInstanceState(Bundle)

This method is called after #onStart when the activity is being re-initialized from a previously saved state, given here in <var>savedInstanceState</var>.

OnResume()

Called after #onRestoreInstanceState, #onRestart, or #onPause.

OnRetainNonConfigurationInstance()

Called by the system, as part of destroying an activity due to a configuration change, when it is known that a new instance will immediately be created for the new configuration.

OnSaveInstanceState(Bundle, PersistableBundle)

This is the same as #onSaveInstanceState but is called for activities created with the attribute android.R.attr#persistableMode set to persistAcrossReboots.

OnSaveInstanceState(Bundle)

Called to retrieve per-instance state from an activity before being killed so that the state can be restored in #onCreate or #onRestoreInstanceState (the Bundle populated by this method will be passed to both).

OnSearchRequested()

Called when the user signals the desire to start a search.

OnSearchRequested(SearchEvent)

This hook is called when the user signals the desire to start a search.

OnStart()

Called after #onCreate &mdash; or after #onRestart when the activity had been stopped, but is now again being displayed to the user.

OnStateNotSaved()

Called when an #onResume is coming up, prior to other pre-resume callbacks such as #onNewIntent and #onActivityResult.

OnStop()

Called when you are no longer visible to the user.

OnTitleChanged(ICharSequence, Color)
OnTitleChanged(String, Color)
OnTopResumedActivityChanged(Boolean)

Called when activity gets or loses the top resumed position in the system.

OnTouchEvent(MotionEvent)

Called when a touch screen event was not handled by any of the views inside of the activity.

OnTrackballEvent(MotionEvent)

Called when the trackball was moved and not handled by any of the views inside of the activity.

OnTrimMemory(TrimMemory)

Called when the operating system has determined that it is a good time for a process to trim unneeded memory from its process.

OnUserInteraction()

Called whenever a key, touch, or trackball event is dispatched to the activity.

OnUserLeaveHint()

Called as part of the activity lifecycle when an activity is about to go into the background as the result of user choice.

OnVisibleBehindCanceled()

Called when a translucent activity over this activity is becoming opaque or another activity is being launched.

OnWindowAttributesChanged(WindowManagerLayoutParams)

This is called whenever the current window attributes change.

OnWindowFocusChanged(Boolean)

Called when the current Window of the activity gains or loses focus.

OnWindowStartingActionMode(ActionMode+ICallback, ActionModeType)

Give the Activity a chance to control the UI for an action mode requested by the system.

OnWindowStartingActionMode(ActionMode+ICallback)

Give the Activity a chance to control the UI for an action mode requested by the system.

OpenContextMenu(View)

Programmatically opens the context menu for a particular view.

OpenFileInput(String)

Open a private file associated with this Context's application package for reading.

(Inherited from ContextWrapper)
OpenFileOutput(String, FileCreationMode)

Open a private file associated with this Context's application package for writing.

(Inherited from ContextWrapper)
OpenOptionsMenu()

Programmatically opens the options menu.

OpenOrCreateDatabase(String, FileCreationMode, SQLiteDatabase+ICursorFactory, IDatabaseErrorHandler)

Open a new private SQLiteDatabase associated with this Context's application package.

(Inherited from ContextWrapper)
OpenOrCreateDatabase(String, FileCreationMode, SQLiteDatabase+ICursorFactory)

Open a new private SQLiteDatabase associated with this Context's application package.

(Inherited from ContextWrapper)
OverrideActivityTransition(OverrideTransition, Int32, Int32, Int32)

Customizes the animation for the activity transition with this activity.

OverrideActivityTransition(OverrideTransition, Int32, Int32)

Customizes the animation for the activity transition with this activity.

OverridePendingTransition(Int32, Int32, Int32)

Call immediately after one of the flavors of #startActivity(Intent) or #finish to specify an explicit transition animation to perform next.

OverridePendingTransition(Int32, Int32)

Call immediately after one of the flavors of #startActivity(Intent) or #finish to specify an explicit transition animation to perform next.

PeekWallpaper()
Obsolete.
(Inherited from ContextWrapper)
PostponeEnterTransition()

Postpone the entering activity transition when Activity was started with android.app.ActivityOptions#makeSceneTransitionAnimation(Activity, android.util.Pair[]).

Recreate()

Cause this Activity to be recreated with a new instance.

RegisterActivityLifecycleCallbacks(Application+IActivityLifecycleCallbacks)

Register an Application.ActivityLifecycleCallbacks instance that receives lifecycle callbacks for only this Activity.

RegisterComponentCallbacks(IComponentCallbacks)

Add a new ComponentCallbacks to the base application of the Context, which will be called at the same times as the ComponentCallbacks methods of activities and other components are called.

(Inherited from Context)
RegisterDeviceIdChangeListener(IExecutor, IIntConsumer)

Adds a new device ID changed listener to the Context, which will be called when the device association is changed by the system.

(Inherited from Context)
RegisterForContextMenu(View)

Registers a context menu to be shown for the given view (multiple views can show the context menu).

RegisterReceiver(BroadcastReceiver, IntentFilter, ActivityFlags)
Obsolete.
(Inherited from ContextWrapper)
RegisterReceiver(BroadcastReceiver, IntentFilter, ReceiverFlags) (Inherited from Context)
RegisterReceiver(BroadcastReceiver, IntentFilter, String, Handler, ActivityFlags)
Obsolete.
(Inherited from ContextWrapper)
RegisterReceiver(BroadcastReceiver, IntentFilter, String, Handler, ReceiverFlags) (Inherited from Context)
RegisterReceiver(BroadcastReceiver, IntentFilter, String, Handler)

Register to receive intent broadcasts, to run in the context of scheduler.

(Inherited from ContextWrapper)
RegisterReceiver(BroadcastReceiver, IntentFilter)

Register a BroadcastReceiver to be run in the main activity thread.

(Inherited from ContextWrapper)
RegisterScreenCaptureCallback(IExecutor, Activity+IScreenCaptureCallback)
ReleaseInstance()

Ask that the local app instance of this activity be released to free up its memory.

RemoveDialog(Int32)
Obsolete.

Removes any internal references to a dialog managed by this Activity.

RemoveStickyBroadcast(Intent)
Obsolete.
(Inherited from ContextWrapper)
RemoveStickyBroadcastAsUser(Intent, UserHandle)
Obsolete.
(Inherited from ContextWrapper)
ReportFullyDrawn()

Report to the system that your app is now fully drawn, for diagnostic and optimization purposes.

RequestDragAndDropPermissions(DragEvent)

Create DragAndDropPermissions object bound to this activity and controlling the access permissions for content URIs associated with the DragEvent.

RequestFullscreenMode(FullscreenModeRequest, IOutcomeReceiver)

Request to put the a freeform activity into fullscreen.

RequestPermissions(String[], Int32)

Requests permissions to be granted to this application.

RequestShowKeyboardShortcuts()

Request the Keyboard Shortcuts screen to show up.

RequestVisibleBehind(Boolean)

Activities that want to remain visible behind a translucent activity above them must call this method anytime between the start of #onResume() and the return from #onPause().

RequestWindowFeature(WindowFeatures)

Enable extended window features.

RequireViewById(Int32)

Finds a view that was identified by the android:id XML attribute that was processed in #onCreate, or throws an IllegalArgumentException if the ID is invalid, or there is no matching view in the hierarchy.

RequireViewById<T>(Int32)
RevokeSelfPermissionOnKill(String)

Triggers the asynchronous revocation of a runtime permission.

(Inherited from Context)
RevokeSelfPermissionsOnKill(ICollection<String>)

Triggers the revocation of one or more permissions for the calling package.

(Inherited from Context)
RevokeUriPermission(String, Uri, ActivityFlags) (Inherited from ContextWrapper)
RevokeUriPermission(Uri, ActivityFlags)

Remove all permissions to access a particular content provider Uri that were previously added with M:Android.Content.Context.GrantUriPermission(System.String,Android.Net.Uri,Android.Net.Uri).

(Inherited from ContextWrapper)
RunOnUiThread(Action)
RunOnUiThread(IRunnable)

Runs the specified action on the UI thread.

SendBroadcast(Intent, String, Bundle)

Broadcast the given intent to all interested BroadcastReceivers, allowing an optional required permission to be enforced.

(Inherited from Context)
SendBroadcast(Intent, String)

Broadcast the given intent to all interested BroadcastReceivers, allowing an optional required permission to be enforced.

(Inherited from ContextWrapper)
SendBroadcast(Intent)

Broadcast the given intent to all interested BroadcastReceivers.

(Inherited from ContextWrapper)
SendBroadcastAsUser(Intent, UserHandle, String)

Version of SendBroadcast(Intent, String) that allows you to specify the user the broadcast will be sent to.

(Inherited from ContextWrapper)
SendBroadcastAsUser(Intent, UserHandle)

Version of SendBroadcast(Intent) that allows you to specify the user the broadcast will be sent to.

(Inherited from ContextWrapper)
SendBroadcastWithMultiplePermissions(Intent, String[])

Broadcast the given intent to all interested BroadcastReceivers, allowing an array of required permissions to be enforced.

(Inherited from Context)
SendOrderedBroadcast(Intent, Int32, String, String, BroadcastReceiver, Handler, String, Bundle, Bundle) (Inherited from ContextWrapper)
SendOrderedBroadcast(Intent, String, BroadcastReceiver, Handler, Result, String, Bundle)

Version of SendBroadcast(Intent) that allows you to receive data back from the broadcast.

(Inherited from ContextWrapper)
SendOrderedBroadcast(Intent, String, Bundle, BroadcastReceiver, Handler, Result, String, Bundle)

Version of #sendBroadcast(Intent) that allows you to receive data back from the broadcast.

(Inherited from Context)
SendOrderedBroadcast(Intent, String, Bundle)

Broadcast the given intent to all interested BroadcastReceivers, delivering them one at a time to allow more preferred receivers to consume the broadcast before it is delivered to less preferred receivers.

(Inherited from Context)
SendOrderedBroadcast(Intent, String, String, BroadcastReceiver, Handler, Result, String, Bundle)

Version of #sendOrderedBroadcast(Intent, String, BroadcastReceiver, Handler, int, String, Bundle) that allows you to specify the App Op to enforce restrictions on which receivers the broadcast will be sent to.

(Inherited from Context)
SendOrderedBroadcast(Intent, String) (Inherited from ContextWrapper)
SendOrderedBroadcastAsUser(Intent, UserHandle, String, BroadcastReceiver, Handler, Result, String, Bundle) (Inherited from ContextWrapper)
SendStickyBroadcast(Intent, Bundle)

Perform a #sendBroadcast(Intent) that is "sticky," meaning the Intent you are sending stays around after the broadcast is complete, so that others can quickly retrieve that data through the return value of #registerReceiver(BroadcastReceiver, IntentFilter).

(Inherited from Context)
SendStickyBroadcast(Intent)
Obsolete.

Perform a #sendBroadcast(Intent) that is "sticky," meaning the Intent you are sending stays around after the broadcast is complete, so that others can quickly retrieve that data through the return value of #registerReceiver(BroadcastReceiver, IntentFilter).

(Inherited from ContextWrapper)
SendStickyBroadcastAsUser(Intent, UserHandle)
Obsolete.
(Inherited from ContextWrapper)
SendStickyOrderedBroadcast(Intent, BroadcastReceiver, Handler, Result, String, Bundle)
Obsolete.
(Inherited from ContextWrapper)
SendStickyOrderedBroadcastAsUser(Intent, UserHandle, BroadcastReceiver, Handler, Result, String, Bundle)
Obsolete.
(Inherited from ContextWrapper)
SetActionBar(Toolbar)

Set a android.widget.Toolbar Toolbar to act as the ActionBar for this Activity window.

SetContentView(Int32)

Set the activity content from a layout resource.

SetContentView(View, ViewGroup+LayoutParams)

Set the activity content from a layout resource.

SetContentView(View)

Set the activity content to an explicit view.

SetDefaultKeyMode(DefaultKey)

Select the default key handling for this activity.

SetEnterSharedElementCallback(SharedElementCallback)

When android.app.ActivityOptions#makeSceneTransitionAnimation(Activity, android.view.View, String) was used to start an Activity, <var>callback</var> will be called to handle shared elements on the launched Activity.

SetExitSharedElementCallback(SharedElementCallback)

When android.app.ActivityOptions#makeSceneTransitionAnimation(Activity, android.view.View, String) was used to start an Activity, <var>callback</var> will be called to handle shared elements on the launching Activity.

SetFeatureDrawable(WindowFeatures, Drawable)

Convenience for calling android.view.Window#setFeatureDrawable(int, Drawable).

SetFeatureDrawableAlpha(WindowFeatures, Int32)

Convenience for calling android.view.Window#setFeatureDrawableAlpha.

SetFeatureDrawableResource(WindowFeatures, Int32)

Convenience for calling android.view.Window#setFeatureDrawableResource.

SetFeatureDrawableUri(WindowFeatures, Uri)

Convenience for calling android.view.Window#setFeatureDrawableUri.

SetFinishOnTouchOutside(Boolean)

Sets whether this activity is finished when touched outside its window's bounds.

SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
SetInheritShowWhenLocked(Boolean)

Specifies whether this Activity should be shown on top of the lock screen whenever the lockscreen is up and this activity has another activity behind it with the showWhenLock attribute set.

SetLocusContext(LocusId, Bundle)

Sets the android.content.LocusId for this activity.

SetPersistent(Boolean)

This member is deprecated.

SetPictureInPictureParams(PictureInPictureParams)

Updates the properties of the picture-in-picture activity, or sets it to be used later when #enterPictureInPictureMode() is called.

SetProgress(Int32)

Sets the progress for the progress bars in the title.

SetProgressBarIndeterminate(Boolean)

Sets whether the horizontal progress bar in the title should be indeterminate (the circular is always indeterminate).

SetProgressBarIndeterminateVisibility(Boolean)

Sets the visibility of the indeterminate progress bar in the title.

SetProgressBarVisibility(Boolean)

Sets the visibility of the progress bar in the title.

SetRecentsScreenshotEnabled(Boolean)

If set to false, this indicates to the system that it should never take a screenshot of the activity to be used as a representation in recents screen.

SetResult(Result, Intent)

Call this to set the result that your activity will return to its caller.

SetResult(Result)

Call this to set the result that your activity will return to its caller.

SetSecondaryProgress(Int32)

Sets the secondary progress for the progress bar in the title.

SetShouldDockBigOverlays(Boolean)

Specifies a preference to dock big overlays like the expanded picture-in-picture on TV (see PictureInPictureParams.Builder#setExpandedAspectRatio).

SetShowWhenLocked(Boolean)

Specifies whether an Activity should be shown on top of the lock screen whenever the lockscreen is up and the activity is resumed.

SetTaskDescription(ActivityManager+TaskDescription)

Sets information describing the task with this activity for presentation inside the Recents System UI.

SetTheme(Int32)

Set the base theme for this context.

(Inherited from ContextWrapper)
SetTheme(Resources+Theme)

Set the configure the current theme.

(Inherited from ContextThemeWrapper)
SetTitle(Int32)

Change the title associated with this activity.

SetTranslucent(Boolean)

Convert an activity, which particularly with android.R.attr#windowIsTranslucent or android.R.attr#windowIsFloating attribute, to a fullscreen opaque activity, or convert it from opaque back to translucent.

SetTurnScreenOn(Boolean)

Specifies whether the screen should be turned on when the Activity is resumed.

SetVisible(Boolean)

Control whether this activity's main window is visible.

SetVrModeEnabled(Boolean, ComponentName)

Enable or disable virtual reality (VR) mode for this Activity.

SetWallpaper(Bitmap)
Obsolete.
(Inherited from ContextWrapper)
SetWallpaper(Stream)
Obsolete.
(Inherited from ContextWrapper)
ShouldDockBigOverlays()

Returns whether big overlays should be docked next to the activity as set by #setShouldDockBigOverlays.

ShouldShowRequestPermissionRationale(String)

Gets whether you should show UI with rationale before requesting a permission.

ShouldUpRecreateTask(Intent)

Returns true if the app should recreate the task when navigating 'up' from this activity by using targetIntent.

ShowAssist(Bundle)

Ask to have the current assistant shown to the user.

ShowDialog(Int32, Bundle)
Obsolete.

Show a dialog managed by this activity.

ShowDialog(Int32)
Obsolete.

Simple version of #showDialog(int, Bundle) that does not take any arguments.

ShowLockTaskEscapeMessage()

Shows the user the system defined message for telling the user how to exit lock task mode.

StartActionMode(ActionMode+ICallback, ActionModeType)

Start an action mode of the default type ActionMode#TYPE_PRIMARY.

StartActionMode(ActionMode+ICallback)

Start an action mode of the default type ActionMode#TYPE_PRIMARY.

StartActivities(Intent[], Bundle)

Launch multiple new activities.

(Inherited from ContextWrapper)
StartActivities(Intent[])

Same as StartActivities(Intent[], Bundle) with no options specified.

(Inherited from ContextWrapper)
StartActivity(Intent, Bundle)

Launch a new activity.

(Inherited from ContextWrapper)
StartActivity(Intent)

Same as StartActivity(Intent, Bundle) with no options specified.

(Inherited from ContextWrapper)
StartActivity(Type) (Inherited from Context)
StartActivityForResult(Intent, Int32, Bundle)

Launch an activity for which you would like a result when it finished.

StartActivityForResult(Intent, Int32)

Same as calling #startActivityForResult(Intent, int, Bundle) with no options.

StartActivityForResult(Type, Int32)
StartActivityFromChild(Activity, Intent, Int32, Bundle)

This is called when a child activity of this one calls its #startActivity or #startActivityForResult method.

StartActivityFromChild(Activity, Intent, Int32)

Same as calling #startActivityFromChild(Activity, Intent, int, Bundle) with no options.

StartActivityFromFragment(Fragment, Intent, Int32, Bundle)

This is called when a Fragment in this activity calls its Fragment#startActivity or Fragment#startActivityForResult method.

StartActivityFromFragment(Fragment, Intent, Int32)

Same as calling #startActivityFromFragment(Fragment, Intent, int, Bundle) with no options.

StartActivityIfNeeded(Intent, Int32, Bundle)

A special variation to launch an activity only if a new activity instance is needed to handle the given Intent.

StartActivityIfNeeded(Intent, Int32)

Same as calling #startActivityIfNeeded(Intent, int, Bundle) with no options.

StartForegroundService(Intent) (Inherited from ContextWrapper)
StartInstrumentation(ComponentName, String, Bundle)

Start executing an Instrumentation class.

(Inherited from ContextWrapper)
StartIntentSender(IntentSender, Intent, ActivityFlags, ActivityFlags, Int32, Bundle)

Like StartActivity(Intent, Bundle), but taking a IntentSender to start.

(Inherited from ContextWrapper)
StartIntentSender(IntentSender, Intent, ActivityFlags, ActivityFlags, Int32) (Inherited from ContextWrapper)
StartIntentSenderForResult(IntentSender, Int32, Intent, ActivityFlags, ActivityFlags, Int32, Bundle)

Like #startActivityForResult(Intent, int), but allowing you to use a IntentSender to describe the activity to be started.

StartIntentSenderForResult(IntentSender, Int32, Intent, ActivityFlags, ActivityFlags, Int32)

Same as calling #startIntentSenderForResult(IntentSender, int, Intent, int, int, int, Bundle) with no options.

StartIntentSenderFromChild(Activity, IntentSender, Int32, Intent, ActivityFlags, ActivityFlags, Int32, Bundle)

Like #startActivityFromChild(Activity, Intent, int), but taking a IntentSender; see #startIntentSenderForResult(IntentSender, int, Intent, int, int, int) for more information.

StartIntentSenderFromChild(Activity, IntentSender, Int32, Intent, ActivityFlags, ActivityFlags, Int32)

Same as calling #startIntentSenderFromChild(Activity, IntentSender, int, Intent, int, int, int, Bundle) with no options.

StartLocalVoiceInteraction(Bundle)

Starts a local voice interaction session.

StartLockTask()

Request to put this activity in a mode where the user is locked to a restricted set of applications.

StartManagingCursor(ICursor)
Obsolete.

This method allows the activity to take care of managing the given Cursor's lifecycle for you based on the activity's lifecycle.

StartNextMatchingActivity(Intent, Bundle)

Special version of starting an activity, for use when you are replacing other activity components.

StartNextMatchingActivity(Intent)

Same as calling #startNextMatchingActivity(Intent, Bundle) with no options.

StartPostponedEnterTransition()

Begin postponed transitions after #postponeEnterTransition() was called.

StartSearch(String, Boolean, Bundle, Boolean)

This hook is called to launch the search UI.

StartService(Intent)

Request that a given application service be started.

(Inherited from ContextWrapper)
StopLocalVoiceInteraction()

Request to terminate the current voice interaction that was previously started using #startLocalVoiceInteraction(Bundle).

StopLockTask()

Stop the current task from being locked.

StopManagingCursor(ICursor)
Obsolete.

Given a Cursor that was previously given to #startManagingCursor, stop the activity's management of that cursor.

StopService(Intent)

Request that a given application service be stopped.

(Inherited from ContextWrapper)
TakeKeyEvents(Boolean)

Request that key events come to this activity.

ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
TriggerSearch(String, Bundle)

Similar to #startSearch, but actually fires off the search query after invoking the search dialog.

UnbindService(IServiceConnection)

Disconnect from an application service.

(Inherited from ContextWrapper)
UnregisterActivityLifecycleCallbacks(Application+IActivityLifecycleCallbacks)

Unregister an Application.ActivityLifecycleCallbacks previously registered with #registerActivityLifecycleCallbacks.

UnregisterComponentCallbacks(IComponentCallbacks)

Remove a ComponentCallbacks object that was previously registered with #registerComponentCallbacks(ComponentCallbacks).

(Inherited from Context)
UnregisterDeviceIdChangeListener(IIntConsumer)

Removes a device ID changed listener from the Context.

(Inherited from Context)
UnregisterForContextMenu(View)

Prevents a context menu to be shown for the given view.

UnregisterFromRuntime() (Inherited from Object)
UnregisterReceiver(BroadcastReceiver)

Unregister a previously registered BroadcastReceiver.

(Inherited from ContextWrapper)
UnregisterScreenCaptureCallback(Activity+IScreenCaptureCallback)
UpdateServiceGroup(IServiceConnection, Int32, Int32)

For a service previously bound with #bindService or a related method, change how the system manages that service's process in relation to other processes.

(Inherited from Context)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to