Geofencing API_IntentService - Android Developers_en
Geofencing API_IntentService - Android Developers_en
com/reference/android/app/IntentService
(/reference/android/app/Service)
java.lang.Object (/reference/java/lang/Object)
↳ android.content.Context (/reference/android/content/Context)
↳ android.content.ContextWrapper (/reference/android/content/ContextWrapper)
↳ android.app.Service (/reference/android/app/Service)
↳ android.app.IntentService
IntentService is an extension of the (/reference/android/app/Service) component class that handles asynchronous requests
(expressed as (/reference/android/content/Intent) s) on demand. Clients send requests through
(/reference/android/content/Context#sta�Service(android.content.Intent)) calls; the service is sta�ed as needed, handles each Intent in turn
using a worker thread, and stops itself when it runs out of work.
This "work queue processor" pa�ern is commonly used to o�oad tasks from an application's main thread. The IntentService class
exists to simplify this pa�ern and take care of the mechanics. To use it, extend IntentService and implement
(/reference/android/app/IntentService#onHandleIntent(android.content.Intent)) . IntentService
will receive the Intents, launch a worker thread, and stop the service as appropriate.
All requests are handled on a single worker thread -- they may take as long as necessary (and will not block the application's main
loop), but only one request will be processed at a time.
For a detailed discussion about how to create services, read the Services (/guide/components/services) developer guide.
See also:
(h�ps://developer.android.com/reference/androidx/core/app/JobIntentService.html)
Inherited constants
Bits returned by
(/reference/android/app/Service#onSta�Command(android.content.Intent,%20int,%20int)) describing how to
continue the service if it is killed.
(/reference/android/app/Service#START_FLAG_REDELIVERY)
(/reference/android/app/Service#START_FLAG_RETRY)
(/reference/android/app/Service#START_NOT_STICKY)
(/reference/android/app/Service#START_REDELIVER_INTENT)
(/reference/android/app/Service#START_STICKY)
(/reference/android/app/Service#START_STICKY_COMPATIBILITY)
(/reference/android/app/Service#STOP_FOREGROUND_DETACH)
(/reference/android/app/Service#STOP_FOREGROUND_LEGACY)
(/reference/android/app/Service#STOP_FOREGROUND_REMOVE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/view/accessibility/AccessibilityManager) for giving the user
feedback for UI events through the registered event listeners.
(/reference/java/lang/String)
(/reference/android/content/Context#ACCOUNT_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/accounts/AccountManager) for receiving intents at a time of your choosing.
(/reference/java/lang/String)
(/reference/android/content/Context#ACTIVITY_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/app/ActivityManager) for interacting with the global system state.
(/reference/java/lang/String)
(/reference/android/content/Context#ALARM_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/app/AlarmManager) for receiving intents at a time of your choosing.
(/reference/java/lang/String)
(/reference/android/content/Context#APPWIDGET_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/appwidget/AppWidgetManager) for accessing AppWidgets.
(/reference/java/lang/String)
(/reference/android/content/Context#APP_OPS_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/app/AppOpsManager) for tracking application operations on the device.
(/reference/java/lang/String)
(/reference/android/content/Context#APP_SEARCH_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve an
(/reference/android/app/appsearch/AppSearchManager) for indexing and querying app data managed by the
system.
(/reference/java/lang/String)
(/reference/android/content/Context#AUDIO_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/media/AudioManager) for handling management of volume, ringer modes and audio
routing.
(/reference/java/lang/String)
(/reference/android/content/Context#BATTERY_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/os/Ba�eryManager) for managing ba�ery state.
(/reference/android/content/Context#BIND_ABOVE_CLIENT)
Flag for
(/reference/android/content/Context#bindService(android.content.Intent,
%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,
%20android.content.ServiceConnection))
: indicates that the client application binding to this service considers the service to be more impo�ant than the
app itself.
(/reference/android/content/Context#BIND_ADJUST_WITH_ACTIVITY)
Flag for
(/reference/android/content/Context#bindService(android.content.Intent,
%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,
%20android.content.ServiceConnection))
: If binding from an activity, allow the target service's process impo�ance to be raised based on whether the
activity is visible to the user, regardless whether another �ag is used to reduce the amount that the client
process's overall impo�ance is used to impact it.
(/reference/android/content/Context#BIND_ALLOW_ACTIVITY_STARTS)
Flag for
(/reference/android/content/Context#bindService(android.content.Intent,
%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,
%20android.content.ServiceConnection))
: If binding from an app that is visible, the bound service is allowed to sta� an activity from background.
(/reference/android/content/Context#BIND_ALLOW_OOM_MANAGEMENT)
Flag for
(/reference/android/content/Context#bindService(android.content.Intent,
%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,
%20android.content.ServiceConnection))
: allow the process hosting the bound service to go through its normal memory management.
(/reference/android/content/Context#BIND_AUTO_CREATE)
Flag for
(/reference/android/content/Context#bindService(android.content.Intent,
%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,
%20android.content.ServiceConnection))
: automatically create the service as long as the binding exists.
(/reference/android/content/Context#BIND_DEBUG_UNBIND)
Flag for
(/reference/android/content/Context#bindService(android.content.Intent,
%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,
%20android.content.ServiceConnection))
: include debugging help for mismatched calls to unbind.
(/reference/android/content/Context#BIND_EXTERNAL_SERVICE)
Flag for
(/reference/android/content/Context#bindService(android.content.Intent,
%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,
%20android.content.ServiceConnection))
: The service being bound is an (/reference/android/R.a�r#isolatedProcess),
(/reference/android/R.a�r#externalService) service.
(/reference/android/content/Context#BIND_EXTERNAL_SERVICE_LONG)
(/reference/android/content/Context#BIND_IMPORTANT)
Flag for
(/reference/android/content/Context#bindService(android.content.Intent,
%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,
%20android.content.ServiceConnection))
: this service is very impo�ant to the client, so should be brought to the foreground process level when the
client is.
(/reference/android/content/Context#BIND_INCLUDE_CAPABILITIES)
Flag for
(/reference/android/content/Context#bindService(android.content.Intent,
%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,
%20android.content.ServiceConnection))
: If binding from an app that has speci�c capabilities due to its foreground state such as an activity or
foreground service, then this �ag will allow the bound app to get the same capabilities, as long as it has the
required permissions as well.
(/reference/android/content/Context#BIND_NOT_FOREGROUND)
Flag for
(/reference/android/content/Context#bindService(android.content.Intent,
%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,
%20android.content.ServiceConnection))
: don't allow this binding to raise the target service's process to the foreground scheduling priority.
(/reference/android/content/Context#BIND_NOT_PERCEPTIBLE)
Flag for
(/reference/android/content/Context#bindService(android.content.Intent,
%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,
%20android.content.ServiceConnection))
: If binding from an app that is visible or user-perceptible, lower the target service's impo�ance to below the
perceptible level.
(/reference/android/content/Context#BIND_SHARED_ISOLATED_PROCESS)
Flag for
(/reference/android/content/Context#bindIsolatedService(android.content.Intent,
%20android.content.Context.BindServiceFlags,%20java.lang.String,%20java.util.concurrent.Executor,
%20android.content.ServiceConnection))
: Bind the service into a shared isolated process.
(/reference/android/content/Context#BIND_WAIVE_PRIORITY)
Flag for
(/reference/android/content/Context#bindService(android.content.Intent,
%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,
%20android.content.ServiceConnection))
: don't impact the scheduling or memory management priority of the target service's hosting process.
(/reference/java/lang/String)
(/reference/android/content/Context#BIOMETRIC_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/hardware/biometrics/BiometricManager) for handling biometric and PIN/pa�ern/password
authentication.
(/reference/java/lang/String)
(/reference/android/content/Context#BLOB_STORE_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/app/blob/BlobStoreManager) for contributing and accessing data blobs from the blob store
maintained by the system.
(/reference/java/lang/String)
(/reference/android/content/Context#BLUETOOTH_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/bluetooth/BluetoothManager) for using Bluetooth.
(/reference/java/lang/String)
(/reference/android/content/Context#BUGREPORT_SERVICE)
(/reference/java/lang/String)
(/reference/android/content/Context#CAMERA_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/hardware/camera2/CameraManager) for interacting with camera devices.
(/reference/java/lang/String)
(/reference/android/content/Context#CAPTIONING_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/view/accessibility/CaptioningManager) for obtaining captioning prope�ies and listening for
changes in captioning preferences.
(/reference/java/lang/String)
(/reference/android/content/Context#CARRIER_CONFIG_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/telephony/CarrierCon�gManager) for reading carrier
con�guration values.
(/reference/java/lang/String)
(/reference/android/content/Context#CLIPBOARD_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/content/ClipboardManager) for accessing and modifying the contents of the global
clipboard.
(/reference/java/lang/String)
(/reference/android/content/Context#COMPANION_DEVICE_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/companion/CompanionDeviceManager) for managing
companion devices
(/reference/java/lang/String)
(/reference/android/content/Context#CONNECTIVITY_DIAGNOSTICS_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/net/ConnectivityDiagnosticsManager) for
pe�orming network connectivity diagnostics as well as receiving network connectivity information from the
system.
(/reference/java/lang/String)
(/reference/android/content/Context#CONNECTIVITY_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/net/ConnectivityManager) for handling management of network
connections.
(/reference/java/lang/String)
(/reference/android/content/Context#CONSUMER_IR_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/hardware/ConsumerIrManager) for transmi�ing infrared signals from the device.
(/reference/android/content/Context#CONTEXT_IGNORE_SECURITY)
(/reference/android/content/Context#CONTEXT_INCLUDE_CODE)
(/reference/android/content/Context#CONTEXT_RESTRICTED)
(/reference/java/lang/String)
(/reference/android/content/Context#CREDENTIAL_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/credentials/CredentialManager) to authenticate a user to your app.
(/reference/java/lang/String)
(/reference/android/content/Context#CROSS_PROFILE_APPS_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/content/pm/CrossPro�leApps) for cross pro�le operations.
(/reference/android/content/Context#DEVICE_ID_DEFAULT)
The default device ID, which is the ID of the primary (non-vi�ual) device.
(/reference/android/content/Context#DEVICE_ID_INVALID)
(/reference/java/lang/String)
(/reference/android/content/Context#DEVICE_LOCK_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/devicelock/DeviceLockManager).
(/reference/java/lang/String)
(/reference/android/content/Context#DEVICE_POLICY_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/app/admin/DevicePolicyManager) for working with global device
policy management.
(/reference/java/lang/String)
(/reference/android/content/Context#DISPLAY_HASH_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to access
(/reference/android/view/displayhash/DisplayHashManager) to handle display hashes.
(/reference/java/lang/String)
(/reference/android/content/Context#DISPLAY_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/hardware/display/DisplayManager) for interacting with display devices.
(/reference/java/lang/String)
(/reference/android/content/Context#DOMAIN_VERIFICATION_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to access
(/reference/android/content/pm/verify/domain/DomainVeri�cationManager) to
retrieve approval and user state for declared web domains.
(/reference/java/lang/String)
(/reference/android/content/Context#DOWNLOAD_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/app/DownloadManager) for requesting HTTP downloads.
(/reference/java/lang/String)
(/reference/android/content/Context#DROPBOX_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/os/DropBoxManager) instance for recording diagnostic logs.
(/reference/java/lang/String)
(/reference/android/content/Context#EUICC_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/telephony/euicc/EuiccManager) to manage the device eUICC (embedded SIM).
(/reference/java/lang/String)
(/reference/android/content/Context#FILE_INTEGRITY_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve an
(/reference/android/security/FileIntegrityManager).
(/reference/java/lang/String)
(/reference/android/content/Context#FINGERPRINT_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/hardware/�ngerprint/FingerprintManager) for handling management of �ngerprints.
(/reference/java/lang/String)
(/reference/android/content/Context#GAME_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/app/GameManager).
(/reference/java/lang/String)
(/reference/android/content/Context#GRAMMATICAL_INFLECTION_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/app/GrammaticalIn�ectionManager).
(/reference/java/lang/String)
(/reference/android/content/Context#HARDWARE_PROPERTIES_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/os/HardwarePrope�iesManager) for accessing the
hardware prope�ies service.
(/reference/java/lang/String)
(/reference/android/content/Context#HEALTHCONNECT_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/health/connect/HealthConnectManager).
(/reference/java/lang/String)
(/reference/android/content/Context#INPUT_METHOD_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/view/inputmethod/InputMethodManager) for accessing input methods.
(/reference/java/lang/String)
(/reference/android/content/Context#INPUT_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/hardware/input/InputManager) for interacting with input devices.
(/reference/java/lang/String)
(/reference/android/content/Context#IPSEC_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/net/IpSecManager) for encrypting Sockets or Networks with IPSec.
(/reference/java/lang/String)
(/reference/android/content/Context#JOB_SCHEDULER_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/app/job/JobScheduler) instance for managing occasional background tasks.
(/reference/java/lang/String)
(/reference/android/content/Context#KEYGUARD_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/app/KeyguardManager) for controlling keyguard.
(/reference/java/lang/String)
(/reference/android/content/Context#LAUNCHER_APPS_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/content/pm/LauncherApps) for querying and monitoring launchable apps across pro�les of
a user.
(/reference/java/lang/String)
(/reference/android/content/Context#LAYOUT_INFLATER_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/view/LayoutIn�ater) for in�ating layout resources in this context.
(/reference/java/lang/String)
(/reference/android/content/Context#LOCALE_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/app/LocaleManager).
(/reference/java/lang/String)
(/reference/android/content/Context#LOCATION_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/location/LocationManager) for controlling location updates.
(/reference/java/lang/String)
(/reference/android/content/Context#MEDIA_COMMUNICATION_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/media/MediaCommunicationManager) for managing
(/reference/android/media/MediaSession2).
(/reference/java/lang/String)
(/reference/android/content/Context#MEDIA_METRICS_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/media/metrics/MediaMetricsManager) for interacting with media
metrics on the device.
(/reference/java/lang/String)
(/reference/android/content/Context#MEDIA_PROJECTION_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/media/projection/MediaProjectionManager) instance for
managing media projection sessions.
(/reference/java/lang/String)
(/reference/android/content/Context#MEDIA_ROUTER_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.Class<T>)) to retrieve a
(/reference/android/media/MediaRouter) for controlling and managing routing of media.
(/reference/java/lang/String)
(/reference/android/content/Context#MEDIA_SESSION_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/media/session/MediaSessionManager) for managing media
Sessions.
(/reference/java/lang/String)
(/reference/android/content/Context#MIDI_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/media/midi/MidiManager) for accessing the MIDI service.
(/reference/android/content/Context#MODE_APPEND)
(/reference/android/content/Context#MODE_ENABLE_WRITE_AHEAD_LOGGING)
Database open �ag: when set, the database is opened with write-ahead logging enabled by default.
(/reference/android/content/Context#MODE_MULTI_PROCESS)
This constant was deprecated in API level 23. MODE_MULTI_PROCESS does not work reliably in some versions
of Android, and fu�hermore does not provide any mechanism for reconciling concurrent modi�cations across
processes. Applications should not a�empt to use it. Instead, they should use an explicit cross-process data
management approach such as (/reference/android/content/ContentProvider).
(/reference/android/content/Context#MODE_NO_LOCALIZED_COLLATORS)
Database open �ag: when set, the database is opened without suppo� for localized collators.
(/reference/android/content/Context#MODE_PRIVATE)
File creation mode: the default mode, where the created �le can only be accessed by the calling application (or
all applications sharing the same user ID).
(/reference/android/content/Context#MODE_WORLD_READABLE)
This constant was deprecated in API level 17. Creating world-readable �les is very dangerous, and likely to cause
security holes in applications. It is strongly discouraged; instead, applications should use more formal
mechanism for interactions such as (/reference/android/content/ContentProvider),
(/reference/android/content/BroadcastReceiver), and
(/reference/android/app/Service). There are no guarantees that this access mode will remain on a �le, such as
when it goes through a backup and restore.
(/reference/android/content/Context#MODE_WORLD_WRITEABLE)
This constant was deprecated in API level 17. Creating world-writable �les is very dangerous, and likely to cause
security holes in applications. It is strongly discouraged; instead, applications should use more formal
mechanism for interactions such as (/reference/android/content/ContentProvider),
(/reference/android/content/BroadcastReceiver), and
(/reference/android/app/Service). There are no guarantees that this access mode will remain on a �le, such as
when it goes through a backup and restore.
(/reference/java/lang/String)
(/reference/android/content/Context#NETWORK_STATS_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/app/usage/NetworkStatsManager) for querying network usage
stats.
(/reference/java/lang/String)
(/reference/android/content/Context#NFC_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/nfc/NfcManager) for using NFC.
(/reference/java/lang/String)
(/reference/android/content/Context#NOTIFICATION_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/app/Noti�cationManager) for informing the user of background
events.
(/reference/java/lang/String)
(/reference/android/content/Context#NSD_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/net/nsd/NsdManager) for handling management of network service discovery
(/reference/java/lang/String)
(/reference/android/content/Context#OVERLAY_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/content/om/OverlayManager) for managing overlay packages.
(/reference/java/lang/String)
(/reference/android/content/Context#PEOPLE_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to access a
(/reference/android/app/people/PeopleManager) to interact with your published conversations.
(/reference/java/lang/String)
(/reference/android/content/Context#PERFORMANCE_HINT_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/os/Pe�ormanceHintManager) for accessing the pe�ormance
hinting service.
(/reference/java/lang/String)
(/reference/android/content/Context#POWER_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/os/PowerManager) for controlling power management, including "wake locks," which let
you keep the device on while you're running long tasks.
(/reference/java/lang/String)
(/reference/android/content/Context#PRINT_SERVICE)
(/reference/android/content/Context#RECEIVER_EXPORTED)
Flag for
(/reference/android/content/Context#registerReceiver(android.content.BroadcastReceiver,
%20android.content.IntentFilter))
: The receiver can receive broadcasts from other Apps.
(/reference/android/content/Context#RECEIVER_NOT_EXPORTED)
Flag for
(/reference/android/content/Context#registerReceiver(android.content.BroadcastReceiver,
%20android.content.IntentFilter))
: The receiver cannot receive broadcasts from other Apps.
(/reference/android/content/Context#RECEIVER_VISIBLE_TO_INSTANT_APPS)
Flag for
(/reference/android/content/Context#registerReceiver(android.content.BroadcastReceiver,
%20android.content.IntentFilter))
: The receiver can receive broadcasts from Instant Apps.
(/reference/java/lang/String)
(/reference/android/content/Context#RESTRICTIONS_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/content/RestrictionsManager) for retrieving application
restrictions and requesting permissions for restricted operations.
(/reference/java/lang/String)
(/reference/android/content/Context#ROLE_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/app/role/RoleManager) for managing roles.
(/reference/java/lang/String)
(/reference/android/content/Context#SEARCH_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/app/SearchManager) for handling searches.
(/reference/java/lang/String)
(/reference/android/content/Context#SENSOR_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/hardware/SensorManager) for accessing sensors.
(/reference/java/lang/String)
(/reference/android/content/Context#SHORTCUT_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/content/pm/Sho�cutManager) for accessing the launcher sho�cut service.
(/reference/java/lang/String)
(/reference/android/content/Context#STATUS_BAR_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/app/StatusBarManager) for interacting with the status bar and quick se�ings.
(/reference/java/lang/String)
(/reference/android/content/Context#STORAGE_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/os/storage/StorageManager) for accessing system storage functions.
(/reference/java/lang/String)
(/reference/android/content/Context#STORAGE_STATS_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/app/usage/StorageStatsManager) for accessing system storage
statistics.
(/reference/java/lang/String)
(/reference/android/content/Context#SYSTEM_HEALTH_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/os/health/SystemHealthManager) for accessing system health
(ba�ery, power, memory, etc) metrics.
(/reference/java/lang/String)
(/reference/android/content/Context#TELECOM_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/telecom/TelecomManager) to manage telecom-related features of the device.
(/reference/java/lang/String)
(/reference/android/content/Context#TELEPHONY_IMS_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve an
(/reference/android/telephony/ims/ImsManager).
(/reference/java/lang/String)
(/reference/android/content/Context#TELEPHONY_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/telephony/TelephonyManager) for handling management the telephony features of the
device.
(/reference/java/lang/String)
(/reference/android/content/Context#TELEPHONY_SUBSCRIPTION_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/telephony/SubscriptionManager) for handling management the
telephony subscriptions of the device.
(/reference/java/lang/String)
(/reference/android/content/Context#TEXT_CLASSIFICATION_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/view/textclassi�er/TextClassi�cationManager) for text
classi�cation services.
(/reference/java/lang/String)
(/reference/android/content/Context#TEXT_SERVICES_MANAGER_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/view/textservice/TextServicesManager) for accessing text
services.
(/reference/java/lang/String)
(/reference/android/content/Context#TV_INPUT_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/media/tv/TvInputManager) for interacting with TV inputs on the device.
(/reference/java/lang/String)
(/reference/android/content/Context#TV_INTERACTIVE_APP_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/media/tv/interactive/TvInteractiveAppManager) for
interacting with TV interactive applications on the device.
(/reference/java/lang/String)
(/reference/android/content/Context#UI_MODE_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/app/UiModeManager) for controlling UI modes.
(/reference/java/lang/String)
(/reference/android/content/Context#USAGE_STATS_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/app/usage/UsageStatsManager) for querying device usage stats.
(/reference/java/lang/String)
(/reference/android/content/Context#USB_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/hardware/usb/UsbManager) for access to USB devices (as a USB host) and for controlling
this device's behavior as a USB device.
(/reference/java/lang/String)
(/reference/android/content/Context#USER_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/os/UserManager) for managing users on devices that suppo� multiple users.
(/reference/java/lang/String)
(/reference/android/content/Context#VIBRATOR_MANAGER_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/os/VibratorManager) for accessing the device vibrators, interacting with individual ones and
playing synchronized e�ects on multiple vibrators.
(/reference/java/lang/String)
(/reference/android/content/Context#VIBRATOR_SERVICE)
(/reference/java/lang/String)
(/reference/android/content/Context#VIRTUAL_DEVICE_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/companion/vi�ual/Vi�ualDeviceManager) for managing vi�ual
devices.
(/reference/java/lang/String)
(/reference/android/content/Context#VPN_MANAGEMENT_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/net/VpnManager) to manage pro�les for the pla�orm built-in VPN.
(/reference/java/lang/String)
(/reference/android/content/Context#WALLPAPER_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
com.android.server.WallpaperService for accessing wallpapers.
(/reference/java/lang/String)
(/reference/android/content/Context#WIFI_AWARE_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/net/wi�/aware/Wi�AwareManager) for handling management of Wi-Fi Aware.
(/reference/java/lang/String)
(/reference/android/content/Context#WIFI_P2P_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/net/wi�/p2p/Wi�P2pManager) for handling management of Wi-Fi peer-to-peer
connections.
(/reference/java/lang/String)
(/reference/android/content/Context#WIFI_RTT_RANGING_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/net/wi�/�t/Wi�R�Manager) for ranging devices with wi�.
(/reference/java/lang/String)
(/reference/android/content/Context#WIFI_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/net/wi�/Wi�Manager) for handling management of Wi-Fi access.
(/reference/java/lang/String) (/reference/android/content/Context#WINDOW_SERVICE)
Use with
(/reference/android/content/Context#getSystemService(java.lang.String)) to retrieve a
(/reference/android/view/WindowManager) for accessing the system's window manager.
(/reference/android/content/ComponentCallbacks2#TRIM_MEMORY_COMPLETE)
process is nearing the end of the background LRU list, and if more memory isn't found soon it will be killed.
(/reference/android/content/ComponentCallbacks2#TRIM_MEMORY_MODERATE)
(/reference/android/content/ComponentCallbacks2#TRIM_MEMORY_RUNNING_CRITICAL)
(/reference/android/content/ComponentCallbacks2#TRIM_MEMORY_RUNNING_LOW)
(/reference/android/content/ComponentCallbacks2#TRIM_MEMORY_RUNNING_MODERATE)
(/reference/android/content/ComponentCallbacks2#TRIM_MEMORY_UI_HIDDEN)
Public constructors
(/reference/android/app/IntentService#IntentService(java.lang.String)) (/reference/java/lang/String)
Creates an IntentService.
Public methods
(/reference/android/app/IntentService#onBind(android.content.Intent))
(/reference/android/os/IBinder) (/reference/android/content/Intent)
Unless you provide binding for your service, you don't need to implement this method, because the default
implementation returns null.
(/reference/android/app/IntentService#onCreate())
(/reference/android/app/IntentService#onDestroy())
Called by the system to notify a Service that it is no longer used and is being removed.
(/reference/android/app/IntentService#onSta�(android.content.Intent,%20int))
(/reference/android/content/Intent)
(/reference/android/app/IntentService#onSta�Command(android.content.Intent,%20int,%20int))
(/reference/android/content/Intent)
(/reference/android/app/IntentService#setIntentRedelivery(boolean))
Protected methods
(/reference/android/app/IntentService#onHandleIntent(android.content.Intent))
(/reference/android/content/Intent)
Inherited methods
(/reference/android/app/Service#dump(java.io.FileDescriptor,%20java.io.PrintWriter,
%20java.lang.String[]))
(/reference/java/io/FileDescriptor) (/reference/java/io/PrintWr
(/reference/java/lang/String)
(/reference/android/app/Application)
(/reference/android/app/Service#getApplication())
(/reference/android/app/Service#getForegroundServiceType()
(/reference/android/app/Service#sta�Foreground(int,%20android.app.Noti�cation)) or
(/reference/android/app/Service#sta�Foreground(int,%20android.app.Noti�cation,%20int)
(/reference/android/app/Service#getForegroundServiceType()
the current foreground service type.
(/reference/android/os/IBinder)
(/reference/android/app/Service#onBind(android.content.Intent))
(/reference/android/content/Intent)
(/reference/android/app/Service#onCon�gurationChanged(android.content.res.Con�guration)
(/reference/android/content/res/Con�guration)
Called by the system when the device con�guration changes while your component is running.
(/reference/android/app/Service#onCreate())
(/reference/android/app/Service#onDestroy())
Called by the system to notify a Service that it is no longer used and is being removed.
(/reference/android/app/Service#onLowMemory())
This is called when the overall system is running low on memory, and actively running processes shoul
trim their memory usage.
(/reference/android/app/Service#onRebind(android.content.Intent))
(/reference/android/content/Intent)
Called when new clients have connected to the service, a�er it had previously been noti�ed that all ha
disconnected in its
(/reference/android/app/Service#onUnbind(android.content.Intent)).
(/reference/android/app/Service#onSta�(android.content.Intent,%20int))
(/reference/android/content/Intent)
(/reference/android/app/Service#onSta�Command(android.content.Intent,%20int,%20int)
(/reference/android/content/Intent)
Called by the system every time a client explicitly sta�s the service by calling
(/reference/android/app/Service#onTaskRemoved(android.content.Intent)
(/reference/android/content/Intent)
This is called if the service is currently running and the user has removed a task that comes from the
service's application.
(/reference/android/app/Service#onTimeout(int))
(/reference/android/app/Service#onTrimMemory(int))
Called when the operating system has determined that it is a good time for a process to trim unneede
memory from its process.
(/reference/android/app/Service#onUnbind(android.content.Intent))
(/reference/android/content/Intent)
Called when all clients have disconnected from a pa�icular inte�ace published by the service.
(/reference/android/app/Service#sta�Foreground(int,%20android.app.Noti�catio
(/reference/android/app/Noti�cation)
(/reference/android/app/Service#sta�Foreground(int,%20android.app.Noti�cation,%20int)
(/reference/android/app/Noti�cation)
An overloaded version of
(/reference/android/app/Service#sta�Foreground(int,%20android.app.Noti�cation)) with additional
foregroundServiceType parameter.
(/reference/android/app/Service#stopForeground(int))
Remove this service from foreground state, allowing it to be killed if more memory is needed.
(/reference/android/app/Service#stopForeground(boolean))
(/reference/android/app/Service#stopSelf())
(/reference/android/app/Service#stopSelf(int))
(/reference/android/app/Service#stopSelfResult(int))
Stop the service if the most recent time it was sta�ed was sta�Id.
(/reference/android/content/ContextWrapper#a�achBaseContext(android.content.Conte
(/reference/android/content/Context)
(/reference/android/content/ContextWrapper#bindIsolatedService(android.content.Inten
%20int,%20java.lang.String,%20java.util.concurrent.Executor,
%20android.content.ServiceConnection))
(/reference/android/content/Intent)
(/reference/java/lang/String)
(/reference/java/util/concurrent/Executor)
(/reference/android/content/ServiceConnection)
Variation of
(/reference/android/content/Context#bindService(android.content.Intent,
%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,
%20android.content.ServiceConnection))
that, in the speci�c case of isolated services, allows the caller to generate multiple instan
of a service from a single component declaration.
(/reference/android/content/ContextWrapper#bindService(android.content.Intent,%20int
%20java.util.concurrent.Executor,%20android.content.ServiceConnection))
(/reference/android/content/Intent)
(/reference/java/util/concurrent/Executor)
(/reference/android/content/ServiceConnection)
Same as
(/reference/android/content/Context#bindService(android.content.Intent,
%20android.content.ServiceConnection,%20int))
with executor to control ServiceConnection callbacks.
(/reference/android/content/ContextWrapper#bindService(android.content.Intent,
%20android.content.ServiceConnection,%20android.content.Context.BindServiceFlags)
(/reference/android/content/Intent)
(/reference/android/content/ServiceConnection)
(/reference/android/content/Context.BindServiceFlags)
See
(/reference/android/content/Context#bindService(android.content.Intent,
%20android.content.ServiceConnection,%20int))
Call
(/reference/android/content/Context.BindServiceFlags#of(long)) to obtain a BindServiceF
object.
(/reference/android/content/ContextWrapper#bindService(android.content.Intent,
%20android.content.ServiceConnection,%20int))
(/reference/android/content/Intent)
(/reference/android/content/ServiceConnection)
(/reference/android/content/ContextWrapper#bindService(android.content.Intent,
%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,
%20android.content.ServiceConnection))
(/reference/android/content/Intent)
(/reference/android/content/Context.BindServiceFlags)
(/reference/java/util/concurrent/Executor)
(/reference/android/content/ServiceConnection)
See
(/reference/android/content/Context#bindService(android.content.Intent,%20int,
%20java.util.concurrent.Executor,%20android.content.ServiceConnection))
Call
(/reference/android/content/Context.BindServiceFlags#of(long)) to obtain a BindServiceF
object.
(/reference/android/content/
ContextWrapper#checkCallingOrSelfPermission(java.lang.String))
(/reference/java/lang/String)
Determine whether the calling process of an IPC or you have been granted a pa�icular
permission.
(/reference/android/content/
ContextWrapper#checkCallingOrSelfUriPermission(android.net.Uri,%20int))
(/reference/android/net/Uri)
Determine whether the calling process of an IPC or you has been granted permission to
access a speci�c URI.
(/reference/android/content/
ContextWrapper#checkCallingOrSelfUriPermissions(java.util.List<android.net.Uri>,%20int
(/reference/java/util/List) (/reference/android/net/Uri)
Determine whether the calling process of an IPC or you has been granted permission to
access a list of URIs.
(/reference/android/content/ContextWrapper#checkCallingPermission(java.lang.String)
(/reference/java/lang/String)
Determine whether the calling process of an IPC you are handling has been granted a
pa�icular permission.
(/reference/android/content/ContextWrapper#checkCallingUriPermission(android.net.Uri
%20int))
(/reference/android/net/Uri)
Determine whether the calling process and user ID has been granted permission to acces
speci�c URI.
(/reference/android/content/
ContextWrapper#checkCallingUriPermissions(java.util.List<android.net.Uri>,%20int)
(/reference/java/util/List) (/reference/android/net/Uri)
Determine whether the calling process and user ID has been granted permission to acces
list of URIs.
(/reference/android/content/ContextWrapper#checkPermission(java.lang.String,%20int,
%20int))
(/reference/java/lang/String)
Determine whether the given permission is allowed for a pa�icular process and user ID
running in the system.
(/reference/android/content/ContextWrapper#checkSelfPermission(java.lang.String)
(/reference/java/lang/String)
(/reference/android/content/ContextWrapper#checkUriPermission(android.net.Uri,
%20java.lang.String,%20java.lang.String,%20int,%20int,%20int))
(/reference/android/net/Uri) (/reference/java/lang/String
(/reference/java/lang/String)
(/reference/android/content/ContextWrapper#checkUriPermission(android.net.Uri,%20in
%20int,%20int))
(/reference/android/net/Uri)
Determine whether a pa�icular process and user ID has been granted permission to acce
speci�c URI.
(/reference/android/content/
ContextWrapper#checkUriPermissions(java.util.List<android.net.Uri>,%20int,%20int,%20
(/reference/java/util/List) (/reference/android/net/Uri)
Determine whether a pa�icular process and user ID has been granted permission to acce
list of URIs.
(/reference/android/content/ContextWrapper#clearWallpaper()
(/reference/android/Manifest.permission#SET_WALLPAPER).
(/reference/android/content/Context)
(/reference/android/content/ContextWrapper#createA�ributionContext(java.lang.String)
(/reference/java/lang/String)
Return a new Context object for the current Context but a�ribute to a di�erent tag.
(/reference/android/content/Context)
(/reference/android/content/
ContextWrapper#createCon�gurationContext(android.content.res.Con�guration)
(/reference/android/content/res/Con�guration)
Return a new Context object for the current Context but whose resources are adjusted to
match the given Con�guration.
(/reference/android/content/Context)
(/reference/android/content/
ContextWrapper#createContext(android.content.ContextParams))
(/reference/android/content/ContextParams)
(/reference/android/content/Context)
(/reference/android/content/ContextWrapper#createDeviceContext(int))
Returns a new object from the current context but with device association given
the .
(/reference/android/content/Context)
(/reference/android/content/ContextWrapper#createDeviceProtectedStorageContext()
Return a new Context object for the current Context but whose storage APIs are backed b
device-protected storage.
(/reference/android/content/Context)
(/reference/android/content/ContextWrapper#createDisplayContext(android.view.Display
(/reference/android/view/Display)
Returns a new object from the current context but with resources adjusted to m
the metrics of .
(/reference/android/content/Context)
(/reference/android/content/ContextWrapper#createPackageContext(java.lang.String,
%20int))
(/reference/java/lang/String)
(/reference/android/content/Context)
(/reference/android/content/ContextWrapper#createWindowContext(int,
%20android.os.Bundle))
(/reference/android/os/Bundle)
(/reference/android/content/Context)
(/reference/android/content/ContextWrapper#createWindowContext(android.view.Displa
%20int,%20android.os.Bundle))
(/reference/android/view/Display)
(/reference/android/os/Bundle)
(/reference/java/lang/String)
(/reference/android/content/ContextWrapper#databaseList()
Returns an array of strings naming the private databases associated with this Context's
application package.
(/reference/android/content/ContextWrapper#deleteDatabase(java.lang.String)
(/reference/java/lang/String)
Delete an existing private SQLiteDatabase associated with this Context's application pack
(/reference/android/content/ContextWrapper#deleteFile(java.lang.String)
(/reference/java/lang/String)
Delete the given private �le associated with this Context's application package.
(/reference/android/content/ContextWrapper#deleteSharedPreferences(java.lang.String)
(/reference/java/lang/String)
(/reference/android/content/
ContextWrapper#enforceCallingOrSelfPermission(java.lang.String,%20java.lang.String)
(/reference/java/lang/String) (/reference/java/lang/Stri
If neither you nor the calling process of an IPC you are handling has been granted a pa�ic
permission, throw a (/reference/java/lang/SecurityException
(/reference/android/content/
ContextWrapper#enforceCallingOrSelfUriPermission(android.net.Uri,%20int,
%20java.lang.String))
(/reference/android/net/Uri)
(/reference/java/lang/String)
If the calling process of an IPC or you has not been granted permission to access a speci
URI, throw (/reference/java/lang/SecurityException).
(/reference/android/content/ContextWrapper#enforceCallingPermission(java.lang.String,
%20java.lang.String))
(/reference/java/lang/String) (/reference/java/lang/Stri
If the calling process of an IPC you are handling has not been granted a pa�icular permis
throw a (/reference/java/lang/SecurityException).
(/reference/android/content/ContextWrapper#enforceCallingUriPermission(android.net.U
%20int,%20java.lang.String))
(/reference/android/net/Uri)
(/reference/java/lang/String)
If the calling process and user ID has not been granted permission to access a speci�c U
throw (/reference/java/lang/SecurityException).
(/reference/android/content/ContextWrapper#enforcePermission(java.lang.String,%20int
%20int,%20java.lang.String))
(/reference/java/lang/String)
(/reference/java/lang/String)
If the given permission is not allowed for a pa�icular process and user ID running in the
system, throw a (/reference/java/lang/SecurityException
(/reference/android/content/ContextWrapper#enforceUriPermission(android.net.Uri,
%20java.lang.String,%20java.lang.String,%20int,%20int,%20int,%20java.lang.String)
(/reference/android/net/Uri) (/reference/java/lang/String
(/reference/java/lang/String)
(/reference/java/lang/String)
(/reference/android/content/ContextWrapper#enforceUriPermission(android.net.Uri,%20
%20int,%20int,%20java.lang.String))
(/reference/android/net/Uri)
(/reference/java/lang/String)
If a pa�icular process and user ID has not been granted permission to access a speci�c U
throw (/reference/java/lang/SecurityException).
(/reference/java/lang/String)
(/reference/android/content/ContextWrapper#�leList())
Returns an array of strings naming the private �les associated with this Context's applica
package.
(/reference/android/content/Context)
(/reference/android/content/ContextWrapper#getApplicationContext())
Return the context of the single, global Application object of the current process.
(/reference/android/content/pm/ApplicationInfo)
(/reference/android/content/ContextWrapper#getApplicationInfo
(/reference/android/content/res/AssetManager)
(/reference/android/content/ContextWrapper#getAssets())
(/reference/android/content/A�ributionSource)
(/reference/android/content/ContextWrapper#getA�ributionSource())
(/reference/android/content/Context)
(/reference/android/content/ContextWrapper#getBaseContext()
(/reference/java/io/File)
(/reference/android/content/ContextWrapper#getCacheDir())
Returns the absolute path to the application speci�c cache directory on the �lesystem.
(/reference/java/lang/ClassLoader)
(/reference/android/content/ContextWrapper#getClassLoader()
Return a class loader you can use to retrieve classes in this package.
(/reference/java/io/File)
(/reference/android/content/ContextWrapper#getCodeCacheDir()
Returns the absolute path to the application speci�c cache directory on the �lesystem
designed for storing cached code.
(/reference/android/content/ContentResolver)
(/reference/android/content/ContextWrapper#getContentResolve
(/reference/java/io/File)
(/reference/android/content/ContextWrapper#getDataDir())
Returns the absolute path to the directory on the �lesystem where all private �les belong
to this app are stored.
(/reference/java/io/File)
(/reference/android/content/ContextWrapper#getDatabasePath(java.lang.String)
(/reference/java/lang/String)
Returns the absolute path on the �lesystem where a database created with
(/reference/android/content/Context#openOrCreateDatabase(java.lang.String,%20int,
%20android.database.sqlite.SQLiteDatabase.CursorFactory))
is stored.
(/reference/android/content/ContextWrapper#getDeviceId())
(/reference/java/io/File)
(/reference/android/content/ContextWrapper#getDir(java.lang.String,%20int)
(/reference/java/lang/String)
Retrieve, creating if needed, a new directory in which the application can place its own
custom data �les.
(/reference/android/view/Display)
(/reference/android/content/ContextWrapper#getDisplay())
(/reference/java/io/File)
(/reference/android/content/ContextWrapper#getExternalCacheDir())
(/reference/java/io/File)
(/reference/android/content/ContextWrapper#getExternalCacheDirs())
(/reference/java/io/File)
(/reference/android/content/ContextWrapper#getExternalFilesDir(java.lang.String)
(/reference/java/lang/String)
Returns the absolute path to the directory on the primary shared/external storage device
where the application can place persistent �les it owns.
(/reference/java/io/File)
(/reference/android/content/ContextWrapper#getExternalFilesDirs(java.lang.String)
(/reference/java/lang/String)
(/reference/java/io/File)
(/reference/android/content/ContextWrapper#getExternalMediaDirs())
This method is deprecated. These directories still exist and are scanned, but developers a
encouraged to migrate to inse�ing content into a
(/reference/android/provider/MediaStore) collection directly, as any app can contribute n
media to (/reference/android/provider/MediaStore) with no permissions
required, sta�ing in
(/reference/android/os/Build.VERSION_CODES#Q).
(/reference/java/io/File)
(/reference/android/content/ContextWrapper#getFileStreamPath(java.lang.String)
(/reference/java/lang/String)
Returns the absolute path on the �lesystem where a �le created with
(/reference/android/content/Context#openFileOutput(java.lang.String,%20int)
(/reference/java/io/File)
(/reference/android/content/ContextWrapper#getFilesDir())
Returns the absolute path to the directory on the �lesystem where �les created with
(/reference/android/content/Context#openFileOutput(java.lang.String,%20int)
(/reference/java/util/concurrent/Executor)
(/reference/android/content/ContextWrapper#getMainExecutor()
(/reference/android/os/Looper)
(/reference/android/content/ContextWrapper#getMainLooper()
Return the Looper for the main thread of the current process.
(/reference/java/io/File)
(/reference/android/content/ContextWrapper#getNoBackupFilesDir())
(/reference/java/io/File)
(/reference/android/content/ContextWrapper#getObbDir())
Return the primary shared/external storage directory where this application's OBB �les (if
there are any) can be found.
(/reference/java/io/File)
(/reference/android/content/ContextWrapper#getObbDirs())
(/reference/java/lang/String)
(/reference/android/content/ContextWrapper#getPackageCodePath())
(/reference/android/content/pm/PackageManager)
(/reference/android/content/ContextWrapper#getPackageManage
(/reference/java/lang/String)
(/reference/android/content/ContextWrapper#getPackageName()
(/reference/java/lang/String)
(/reference/android/content/ContextWrapper#getPackageResourcePath())
(/reference/android/content/ContextParams)
(/reference/android/content/ContextWrapper#getParams())
Return the set of parameters which this Context was created with, if it was created via
(/reference/android/content/Context#createContext(android.content.ContextParams)
(/reference/android/content/res/Resources)
(/reference/android/content/ContextWrapper#getResources()
(/reference/android/content/SharedPreferences)
(/reference/android/content/ContextWrapper#getSharedPreferences(java.lang.String,
%20int))
(/reference/java/lang/String)
Retrieve and hold the contents of the preferences �le 'name', returning a SharedPreferen
through which you can retrieve and modify its values.
(/reference/java/lang/Object)
(/reference/android/content/ContextWrapper#getSystemService(java.lang.String)
(/reference/java/lang/String)
(/reference/java/lang/String)
(/reference/android/content/ContextWrapper#getSystemServiceName(java.lang.Class<?>
(/reference/java/lang/Class)
Gets the name of the system-level service that is represented by the speci�ed class.
(/reference/android/content/res/Resources.Theme)
(/reference/android/content/ContextWrapper#getTheme())
(/reference/android/graphics/drawable/Drawable)
(/reference/android/content/ContextWrapper#getWallpaper()
(/reference/android/content/ContextWrapper#getWallpaperDesiredMinimumHeight()
(/reference/android/content/ContextWrapper#getWallpaperDesiredMinimumWidth()
(/reference/android/content/ContextWrapper#grantUriPermission(java.lang.String,
%20android.net.Uri,%20int))
(/reference/java/lang/String) (/reference/android/net/Uri
Grant permission to access a speci�c Uri to another package, regardless of whether that
package has general permission to access the Uri's content provider.
(/reference/android/content/ContextWrapper#isDeviceProtectedStorage())
Indicates if the storage APIs of this Context are backed by device-protected storage.
(/reference/android/content/ContextWrapper#isRestricted())
(/reference/android/content/ContextWrapper#moveDatabaseFrom(android.content.Cont
%20java.lang.String))
(/reference/android/content/Context)
(/reference/java/lang/String)
Move an existing database �le from the given source storage context to this context.
(/reference/android/content/
ContextWrapper#moveSharedPreferencesFrom(android.content.Context,
%20java.lang.String))
(/reference/android/content/Context)
(/reference/java/lang/String)
Move an existing shared preferences �le from the given source storage context to this
context.
(/reference/java/io/FileInputStream)
(/reference/android/content/ContextWrapper#openFileInput(java.lang.String)
(/reference/java/lang/String)
Open a private �le associated with this Context's application package for reading.
(/reference/java/io/FileOutputStream)
(/reference/android/content/ContextWrapper#openFileOutput(java.lang.String,%20int)
(/reference/java/lang/String)
Open a private �le associated with this Context's application package for writing.
(/reference/android/database/sqlite/SQLiteDatabase)
(/reference/android/content/ContextWrapper#openOrCreateDatabase(java.lang.String,
%20int,%20android.database.sqlite.SQLiteDatabase.CursorFactory,
%20android.database.DatabaseErrorHandler))
(/reference/java/lang/String)
(/reference/android/database/sqlite/SQLiteDatabase.CursorFactory
(/reference/android/database/DatabaseErrorHand
Open a new private SQLiteDatabase associated with this Context's application package.
(/reference/android/database/sqlite/SQLiteDatabase)
(/reference/android/content/ContextWrapper#openOrCreateDatabase(java.lang.String,
%20int,%20android.database.sqlite.SQLiteDatabase.CursorFactory))
(/reference/java/lang/String)
(/reference/android/database/sqlite/SQLiteDatabase.CursorFactory
Open a new private SQLiteDatabase associated with this Context's application package.
(/reference/android/graphics/drawable/Drawable)
(/reference/android/content/ContextWrapper#peekWallpaper()
(/reference/android/content/
ContextWrapper#registerComponentCallbacks(android.content.ComponentCallbacks)
(/reference/android/content/ComponentCallbacks)
(/reference/android/content/
ContextWrapper#registerDeviceIdChangeListener(java.util.concurrent.Executor,
%20java.util.function.IntConsumer))
(/reference/java/util/concurrent/Executor)
(/reference/java/util/function/IntConsumer)
Adds a new device ID changed listener to the , which will be called when the dev
association is changed by the system.
(/reference/android/content/Intent)
(/reference/android/content/
ContextWrapper#registerReceiver(android.content.BroadcastReceiver,
%20android.content.IntentFilter))
(/reference/android/content/BroadcastReceiver)
(/reference/android/content/IntentFilter)
(/reference/android/content/Intent)
(/reference/android/content/
ContextWrapper#registerReceiver(android.content.BroadcastReceiver,
%20android.content.IntentFilter,%20int))
(/reference/android/content/BroadcastReceiver)
(/reference/android/content/IntentFilter)
Register to receive intent broadcasts, with the receiver optionally being exposed to Instan
Apps.
(/reference/android/content/Intent)
(/reference/android/content/
ContextWrapper#registerReceiver(android.content.BroadcastReceiver,
%20android.content.IntentFilter,%20java.lang.String,%20android.os.Handler,%20int)
(/reference/android/content/BroadcastReceiver)
(/reference/android/content/IntentFilter)
(/reference/java/lang/String)
(/reference/android/os/Handler)
(/reference/android/content/Intent)
(/reference/android/content/
ContextWrapper#registerReceiver(android.content.BroadcastReceiver,
%20android.content.IntentFilter,%20java.lang.String,%20android.os.Handler)
(/reference/android/content/BroadcastReceiver)
(/reference/android/content/IntentFilter)
(/reference/java/lang/String)
(/reference/android/os/Handler)
(/reference/android/content/
ContextWrapper#removeStickyBroadcast(android.content.Intent))
(/reference/android/content/Intent)
This method is deprecated. Sticky broadcasts should not be used. They provide no secur
(anyone can access them), no protection (anyone can modify them), and many other
problems. The recommended pa�ern is to use a non-sticky broadcast to repo� that
something has changed, with another mechanism for apps to retrieve the current value
whenever desired.
(/reference/android/content/
ContextWrapper#removeStickyBroadcastAsUser(android.content.Intent,
%20android.os.UserHandle))
(/reference/android/content/Intent)
(/reference/android/os/UserHandle)
This method is deprecated. Sticky broadcasts should not be used. They provide no secur
(anyone can access them), no protection (anyone can modify them), and many other
problems. The recommended pa�ern is to use a non-sticky broadcast to repo� that
something has changed, with another mechanism for apps to retrieve the current value
whenever desired.
(/reference/android/content/
ContextWrapper#revokeSelfPermissionsOnKill(java.util.Collection<java.lang.String>)
(/reference/java/util/Collection) (/reference/java/lang/String
Triggers the revocation of one or more permissions for the calling package.
(/reference/android/content/ContextWrapper#revokeUriPermission(android.net.Uri,%20in
(/reference/android/net/Uri)
Remove all permissions to access a pa�icular content provider Uri that were previously ad
with
(/reference/android/content/Context#grantUriPermission(java.lang.String,%20android.ne
%20int))
or any other mechanism.
(/reference/android/content/ContextWrapper#revokeUriPermission(java.lang.String,
%20android.net.Uri,%20int))
(/reference/java/lang/String) (/reference/android/net/U
Remove permissions to access a pa�icular content provider Uri that were previously adde
with
(/reference/android/content/Context#grantUriPermission(java.lang.String,%20android.ne
%20int))
for a speci�c target package.
(/reference/android/content/ContextWrapper#sendBroadcast(android.content.Intent,
%20java.lang.String,%20android.os.Bundle))
(/reference/android/content/Intent) (/reference/java/lang/Str
(/reference/android/os/Bundle)
Broadcast the given intent to all interested BroadcastReceivers, allowing an optional requ
permission to be enforced.
(/reference/android/content/ContextWrapper#sendBroadcast(android.content.Intent,
%20java.lang.String))
(/reference/android/content/Intent) (/reference/java/lang/Str
Broadcast the given intent to all interested BroadcastReceivers, allowing an optional requ
permission to be enforced.
(/reference/android/content/ContextWrapper#sendBroadcast(android.content.Intent)
(/reference/android/content/Intent)
(/reference/android/content/ContextWrapper#sendBroadcastAsUser(android.content.Int
%20android.os.UserHandle))
(/reference/android/content/Intent)
(/reference/android/os/UserHandle)
Version of
(/reference/android/content/Context#sendBroadcast(android.content.Intent)
to specify the user the broadcast will be sent to.
(/reference/android/content/ContextWrapper#sendBroadcastAsUser(android.content.Int
%20android.os.UserHandle,%20java.lang.String))
(/reference/android/content/Intent)
(/reference/android/os/UserHandle) (/reference/java/lang/String
Version of
(/reference/android/content/Context#sendBroadcast(android.content.Intent,
%20java.lang.String))
that allows you to specify the user the broadcast will be sent to.
(/reference/android/content/ContextWrapper#sendOrderedBroadcast(android.content.In
%20java.lang.String,%20java.lang.String,%20android.content.BroadcastReceiver,
%20android.os.Handler,%20int,%20java.lang.String,%20android.os.Bundle))
(/reference/android/content/Intent) (/reference/java/lang/Str
(/reference/java/lang/String)
(/reference/android/content/BroadcastReceiver)
(/reference/android/os/Handler)
(/reference/java/lang/String) (/reference/android/os/Bundle
Version of
(/reference/android/content/Context#sendOrderedBroadcast(android.content.Intent,
%20java.lang.String,%20android.content.BroadcastReceiver,%20android.os.Handler,%20
%20java.lang.String,%20android.os.Bundle))
that allows you to specify the App Op to enforce restrictions on which receivers the
broadcast will be sent to.
(/reference/android/content/ContextWrapper#sendOrderedBroadcast(android.content.In
%20int,%20java.lang.String,%20java.lang.String,%20android.content.BroadcastReceiver,
%20android.os.Handler,%20java.lang.String,%20android.os.Bundle,%20android.os.Bundl
(/reference/android/content/Intent)
(/reference/java/lang/String) (/reference/java/lang/St
(/reference/android/content/BroadcastReceive
(/reference/android/os/Handler)
(/reference/java/lang/String) (/reference/android/os/Bundle
(/reference/android/os/Bundle)
(/reference/android/content/ContextWrapper#sendOrderedBroadcast(android.content.In
%20java.lang.String,%20android.content.BroadcastReceiver,%20android.os.Handler,%20
%20java.lang.String,%20android.os.Bundle))
(/reference/android/content/Intent) (/reference/java/lang/Str
(/reference/android/content/BroadcastReceiver)
(/reference/android/os/Handler)
(/reference/java/lang/String) (/reference/android/os/Bundle
Version of
(/reference/android/content/Context#sendBroadcast(android.content.Intent)
to receive data back from the broadcast.
(/reference/android/content/ContextWrapper#sendOrderedBroadcast(android.content.In
%20java.lang.String,%20android.os.Bundle))
(/reference/android/content/Intent) (/reference/java/lang/Str
(/reference/android/os/Bundle)
Broadcast the given intent to all interested BroadcastReceivers, delivering them one at a
to allow more preferred receivers to consume the broadcast before it is delivered to less
preferred receivers.
(/reference/android/content/ContextWrapper#sendOrderedBroadcast(android.content.In
%20java.lang.String,%20android.os.Bundle,%20android.content.BroadcastReceiver,
%20android.os.Handler,%20int,%20java.lang.String,%20android.os.Bundle))
(/reference/android/content/Intent) (/reference/java/lang/Str
(/reference/android/os/Bundle)
(/reference/android/content/BroadcastReceiver)
(/reference/android/os/Handler)
(/reference/java/lang/String) (/reference/android/os/Bundle
Version of
(/reference/android/content/Context#sendBroadcast(android.content.Intent)
to receive data back from the broadcast.
(/reference/android/content/ContextWrapper#sendOrderedBroadcast(android.content.In
%20java.lang.String))
(/reference/android/content/Intent) (/reference/java/lang/Str
Broadcast the given intent to all interested BroadcastReceivers, delivering them one at a
to allow more preferred receivers to consume the broadcast before it is delivered to less
preferred receivers.
(/reference/android/content/
ContextWrapper#sendOrderedBroadcastAsUser(android.content.Intent,
%20android.os.UserHandle,%20java.lang.String,%20android.content.BroadcastReceiver,
%20android.os.Handler,%20int,%20java.lang.String,%20android.os.Bundle))
(/reference/android/content/Intent)
(/reference/android/os/UserHandle) (/reference/java/lang/String
(/reference/android/content/BroadcastReceiver)
(/reference/android/os/Handler)
(/reference/java/lang/String) (/reference/android/os/Bundle
Version of
(/reference/android/content/Context#sendOrderedBroadcast(android.content.Intent,
%20java.lang.String,%20android.content.BroadcastReceiver,%20android.os.Handler,%20
%20java.lang.String,%20android.os.Bundle))
that allows you to specify the user the broadcast will be sent to.
(/reference/android/content/ContextWrapper#sendStickyBroadcast(android.content.Inte
(/reference/android/content/Intent)
This method is deprecated. Sticky broadcasts should not be used. They provide no secur
(anyone can access them), no protection (anyone can modify them), and many other
problems. The recommended pa�ern is to use a non-sticky broadcast to repo� that
something has changed, with another mechanism for apps to retrieve the current value
whenever desired.
(/reference/android/content/ContextWrapper#sendStickyBroadcast(android.content.Inte
%20android.os.Bundle))
(/reference/android/content/Intent)
(/reference/android/os/Bundle)
This method is deprecated. Sticky broadcasts should not be used. They provide no secur
(anyone can access them), no protection (anyone can modify them), and many other
problems. The recommended pa�ern is to use a non-sticky broadcast to repo� that
something has changed, with another mechanism for apps to retrieve the current value
whenever desired.
(/reference/android/content/
ContextWrapper#sendStickyBroadcastAsUser(android.content.Intent,
%20android.os.UserHandle))
(/reference/android/content/Intent)
(/reference/android/os/UserHandle)
This method is deprecated. Sticky broadcasts should not be used. They provide no secur
(anyone can access them), no protection (anyone can modify them), and many other
problems. The recommended pa�ern is to use a non-sticky broadcast to repo� that
something has changed, with another mechanism for apps to retrieve the current value
whenever desired.
(/reference/android/content/
ContextWrapper#sendStickyOrderedBroadcast(android.content.Intent,
%20android.content.BroadcastReceiver,%20android.os.Handler,%20int,%20java.lang.Stri
%20android.os.Bundle))
(/reference/android/content/Intent)
(/reference/android/content/BroadcastReceiver)
(/reference/android/os/Handler)
(/reference/java/lang/String) (/reference/android/os/Bundle
This method is deprecated. Sticky broadcasts should not be used. They provide no secur
(anyone can access them), no protection (anyone can modify them), and many other
(/reference/android/content/
ContextWrapper#sendStickyOrderedBroadcastAsUser(android.content.Intent,
%20android.os.UserHandle,%20android.content.BroadcastReceiver,%20android.os.Hand
%20int,%20java.lang.String,%20android.os.Bundle))
(/reference/android/content/Intent)
(/reference/android/os/UserHandle)
(/reference/android/content/BroadcastReceiver)
(/reference/android/os/Handler)
(/reference/java/lang/String) (/reference/android/os/Bundle
This method is deprecated. Sticky broadcasts should not be used. They provide no secur
(anyone can access them), no protection (anyone can modify them), and many other
problems. The recommended pa�ern is to use a non-sticky broadcast to repo� that
something has changed, with another mechanism for apps to retrieve the current value
whenever desired.
(/reference/android/content/ContextWrapper#setTheme(int))
(/reference/android/content/ContextWrapper#setWallpaper(android.graphics.Bitmap)
(/reference/android/graphics/Bitmap)
(/reference/android/Manifest.permission#SET_WALLPAPER).
(/reference/android/content/ContextWrapper#setWallpaper(java.io.InputStream)
(/reference/java/io/InputStream)
(/reference/android/Manifest.permission#SET_WALLPAPER).
(/reference/android/content/ContextWrapper#sta�Activities(android.content.Intent[],
%20android.os.Bundle))
(/reference/android/content/Intent)
(/reference/android/os/Bundle)
(/reference/android/content/ContextWrapper#sta�Activities(android.content.Intent[])
(/reference/android/content/Intent)
Same as
(/reference/android/content/Context#sta�Activities(android.content.Intent[],
%20android.os.Bundle))
with no options speci�ed.
(/reference/android/content/ContextWrapper#sta�Activity(android.content.Intent)
(/reference/android/content/Intent)
Same as
(/reference/android/content/Context#sta�Activity(android.content.Intent,
%20android.os.Bundle))
with no options speci�ed.
(/reference/android/content/ContextWrapper#sta�Activity(android.content.Intent,
%20android.os.Bundle))
(/reference/android/content/Intent)
(/reference/android/os/Bundle)
(/reference/android/content/ComponentName)
(/reference/android/content/
ContextWrapper#sta�ForegroundService(android.content.Intent))
(/reference/android/content/Intent)
Similar to
(/reference/android/content/Context#sta�Service(android.content.Intent)), but with an
implicit promise that the Service will call
(/reference/android/app/Service#sta�Foreground(int,%20android.app.Noti�cation)
begins running.
(/reference/android/content/
ContextWrapper#sta�Instrumentation(android.content.ComponentName,
%20java.lang.String,%20android.os.Bundle))
(/reference/android/content/ComponentName)
(/reference/java/lang/String) (/reference/android/os/Bundle
(/reference/android/content/
ContextWrapper#sta�IntentSender(android.content.IntentSender,%20android.content.In
%20int,%20int,%20int))
(/reference/android/content/IntentSender)
(/reference/android/content/Intent)
Same as
(/reference/android/content/Context#sta�IntentSender(android.content.IntentSender,
%20android.content.Intent,%20int,%20int,%20int,%20android.os.Bundle))
with no options speci�ed.
(/reference/android/content/
ContextWrapper#sta�IntentSender(android.content.IntentSender,%20android.content.In
%20int,%20int,%20int,%20android.os.Bundle))
(/reference/android/content/IntentSender)
(/reference/android/content/Intent)
(/reference/android/os/Bundle)
Like
(/reference/android/content/Context#sta�Activity(android.content.Intent,
%20android.os.Bundle))
, but taking a IntentSender to sta�.
(/reference/android/content/ComponentName)
(/reference/android/content/ContextWrapper#sta�Service(android.content.Intent)
(/reference/android/content/Intent)
(/reference/android/content/ContextWrapper#stopService(android.content.Intent)
(/reference/android/content/Intent)
(/reference/android/content/
ContextWrapper#unbindService(android.content.ServiceConnection))
(/reference/android/content/ServiceConnection)
(/reference/android/content/
ContextWrapper#unregisterComponentCallbacks(android.content.ComponentCallbacks)
(/reference/android/content/ComponentCallbacks)
Remove a (/reference/android/content/ComponentCallbacks
that was previously registered with
(/reference/android/content/
ContextWrapper#registerComponentCallbacks(android.content.ComponentCallbacks)
.
(/reference/android/content/
ContextWrapper#unregisterDeviceIdChangeListener(java.util.function.IntConsumer)
(/reference/java/util/function/IntConsumer)
(/reference/android/content/
ContextWrapper#unregisterReceiver(android.content.BroadcastReceiver))
(/reference/android/content/BroadcastReceiver)
(/reference/android/content/
ContextWrapper#updateServiceGroup(android.content.ServiceConnection,%20int,%20in
(/reference/android/content/ServiceConnection)
(/reference/android/content/Context#bindService(android.content.Intent,
%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,
%20android.content.ServiceConnection))
or a related method, change how the system manages that service's process in relation to
other processes.
(/reference/android/content/Context#bindIsolatedService(android.content.In
%20int,%20java.lang.String,%20java.util.concurrent.Executor,
%20android.content.ServiceConnection))
(/reference/android/content/Intent)
(/reference/java/lang/String)
(/reference/java/util/concurrent/Executor)
(/reference/android/content/ServiceConnection)
Variation of
(/reference/android/content/Context#bindService(android.content.Intent,
%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Execu
%20android.content.ServiceConnection))
that, in the speci�c case of isolated services, allows the caller to generate
multiple instances of a service from a single component declaration.
(/reference/android/content/Context#bindIsolatedService(android.content.In
%20android.content.Context.BindServiceFlags,%20java.lang.String,
%20java.util.concurrent.Executor,%20android.content.ServiceConnection)
(/reference/android/content/Intent)
(/reference/android/content/Context.BindServiceFlags
(/reference/java/lang/String)
(/reference/java/util/concurrent/Executor)
(/reference/android/content/ServiceConnection)
See
(/reference/android/content/Context#bindIsolatedService(android.content.In
%20int,%20java.lang.String,%20java.util.concurrent.Executor,
%20android.content.ServiceConnection))
Call
(/reference/android/content/Context.BindServiceFlags#of(long)) to obtain a
BindServiceFlags object.
(/reference/android/content/Context#bindService(android.content.Intent,%20
%20java.util.concurrent.Executor,%20android.content.ServiceConnection)
(/reference/android/content/Intent)
(/reference/java/util/concurrent/Executor)
(/reference/android/content/ServiceConnection
Same as
(/reference/android/content/Context#bindService(android.content.Intent,
%20android.content.ServiceConnection,%20int))
with executor to control ServiceConnection callbacks.
(/reference/android/content/Context#bindService(android.content.Intent,
%20android.content.ServiceConnection,
%20android.content.Context.BindServiceFlags))
(/reference/android/content/Intent)
(/reference/android/content/ServiceConnection)
(/reference/android/content/Context.BindServiceFlags
See
(/reference/android/content/Context#bindService(android.content.Intent,
%20android.content.ServiceConnection,%20int))
Call
(/reference/android/content/Context.BindServiceFlags#of(long)) to obtain a
BindServiceFlags object.
(/reference/android/content/Context#bindService(android.content.Intent,
%20android.content.ServiceConnection,%20int))
(/reference/android/content/Intent)
(/reference/android/content/ServiceConnection)
(/reference/android/content/Context#bindService(android.content.Intent,
%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Execu
%20android.content.ServiceConnection))
(/reference/android/content/Intent)
(/reference/android/content/Context.BindServiceFlags
(/reference/java/util/concurrent/Executor)
(/reference/android/content/ServiceConnection
See
(/reference/android/content/Context#bindService(android.content.Intent,%20
%20java.util.concurrent.Executor,%20android.content.ServiceConnection)
Call
(/reference/android/content/Context.BindServiceFlags#of(long)) to obtain a
BindServiceFlags object.
(/reference/android/content/Context#bindServiceAsUser(android.content.Int
%20android.content.ServiceConnection,%20int,%20android.os.UserHandle)
(/reference/android/content/Intent)
(/reference/android/content/ServiceConnection)
(/reference/android/os/UserHandle)
(/reference/android/content/Context#bindService(android.content.Intent,
%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Execu
%20android.content.ServiceConnection))
.
(/reference/android/content/Context#bindServiceAsUser(android.content.Int
%20android.content.ServiceConnection,
%20android.content.Context.BindServiceFlags,%20android.os.UserHandle)
(/reference/android/content/Intent)
(/reference/android/content/ServiceConnection)
(/reference/android/content/Context.BindServiceFlags
(/reference/android/os/UserHandle)
See
(/reference/android/content/Context#bindServiceAsUser(android.content.Int
%20android.content.ServiceConnection,%20int,%20android.os.UserHandle)
Call
(/reference/android/content/Context.BindServiceFlags#of(long)) to obtain a
BindServiceFlags object.
(/reference/android/content/
Context#checkCallingOrSelfPermission(java.lang.String))
(/reference/java/lang/String)
Determine whether the calling process of an IPC or you have been granted a
pa�icular permission.
(/reference/android/content/
Context#checkCallingOrSelfUriPermission(android.net.Uri,%20int)
(/reference/android/net/Uri)
Determine whether the calling process of an IPC or you has been granted
permission to access a speci�c URI.
(/reference/android/content/
Context#checkCallingOrSelfUriPermissions(java.util.List<android.net.Uri>,
%20int))
(/reference/java/util/List) (/reference/android/net/Uri)
Determine whether the calling process of an IPC or you has been granted
permission to access a list of URIs.
(/reference/android/content/Context#checkCallingPermission(java.lang.String
(/reference/java/lang/String)
Determine whether the calling process of an IPC you are handling has been
granted a pa�icular permission.
(/reference/android/content/Context#checkCallingUriPermission(android.net
%20int))
(/reference/android/net/Uri)
Determine whether the calling process and user ID has been granted permiss
to access a speci�c URI.
(/reference/android/content/
Context#checkCallingUriPermissions(java.util.List<android.net.Uri>,%20int)
(/reference/java/util/List) (/reference/android/net/Uri)
Determine whether the calling process and user ID has been granted permiss
to access a list of URIs.
(/reference/android/content/Context#checkPermission(java.lang.String,%20i
%20int))
(/reference/java/lang/String)
(/reference/android/content/Context#checkSelfPermission(java.lang.String)
(/reference/java/lang/String)
(/reference/android/content/Context#checkUriPermission(android.net.Uri,
%20java.lang.String,%20java.lang.String,%20int,%20int,%20int))
(/reference/android/net/Uri) (/reference/java/lang/String
(/reference/java/lang/String)
(/reference/android/content/Context#checkUriPermission(android.net.Uri,%2
%20int,%20int))
(/reference/android/net/Uri)
Determine whether a pa�icular process and user ID has been granted permis
to access a speci�c URI.
(/reference/android/content/
Context#checkUriPermissions(java.util.List<android.net.Uri>,%20int,%20int,
%20int))
(/reference/java/util/List) (/reference/android/net/Uri)
Determine whether a pa�icular process and user ID has been granted permis
to access a list of URIs.
(/reference/android/content/Context#clearWallpaper()
(/reference/android/Manifest.permission#SET_WALLPAPER).
(/reference/android/content/Context)
(/reference/android/content/Context#createA�ributionContext(java.lang.Strin
(/reference/java/lang/String)
Return a new Context object for the current Context but a�ribute to a di�eren
tag.
(/reference/android/content/Context)
(/reference/android/content/
Context#createCon�gurationContext(android.content.res.Con�guration)
(/reference/android/content/res/Con�guration)
Return a new Context object for the current Context but whose resources are
(/reference/android/content/Context)
(/reference/android/content/
Context#createContext(android.content.ContextParams))
(/reference/android/content/ContextParams)
(/reference/android/content/Context)
(/reference/android/content/Context#createContextForSplit(java.lang.String)
(/reference/java/lang/String)
(/reference/android/content/Context)
(/reference/android/content/Context#createDeviceContext(int))
Returns a new object from the current context but with device
association given by the .
(/reference/android/content/Context)
(/reference/android/content/Context#createDeviceProtectedStorageContext
Return a new Context object for the current Context but whose storage APIs a
backed by device-protected storage.
(/reference/android/content/Context)
(/reference/android/content/
Context#createDisplayContext(android.view.Display))
(/reference/android/view/Display)
Returns a new object from the current context but with resources
adjusted to match the metrics of .
(/reference/android/content/Context)
(/reference/android/content/Context#createPackageContext(java.lang.String
%20int))
(/reference/java/lang/String)
(/reference/android/content/Context)
(/reference/android/content/Context#createWindowContext(int,
%20android.os.Bundle))
(/reference/android/os/Bundle)
(/reference/android/content/Context)
(/reference/android/content/Context#createWindowContext(android.view.Dis
%20int,%20android.os.Bundle))
(/reference/android/view/Display)
(/reference/android/os/Bundle)
(/reference/java/lang/String)
(/reference/android/content/Context#databaseList()
Returns an array of strings naming the private databases associated with this
Context's application package.
(/reference/android/content/Context#deleteDatabase(java.lang.String)
(/reference/java/lang/String)
(/reference/android/content/Context#deleteFile(java.lang.String
(/reference/java/lang/String)
Delete the given private �le associated with this Context's application packag
(/reference/android/content/Context#deleteSharedPreferences(java.lang.Stri
(/reference/java/lang/String)
(/reference/android/content/
Context#enforceCallingOrSelfPermission(java.lang.String,%20java.lang.String
(/reference/java/lang/String)
(/reference/java/lang/String)
If neither you nor the calling process of an IPC you are handling has been gra
a pa�icular permission, throw a
(/reference/java/lang/SecurityException).
(/reference/android/content/
Context#enforceCallingOrSelfUriPermission(android.net.Uri,%20int,
%20java.lang.String))
(/reference/android/net/Uri)
(/reference/java/lang/String)
If the calling process of an IPC or you has not been granted permission to acc
a speci�c URI, throw
(/reference/java/lang/SecurityException).
(/reference/android/content/Context#enforceCallingPermission(java.lang.Stri
%20java.lang.String))
(/reference/java/lang/String)
(/reference/java/lang/String)
If the calling process of an IPC you are handling has not been granted a pa�ic
permission, throw a
(/reference/java/lang/SecurityException).
(/reference/android/content/
Context#enforceCallingUriPermission(android.net.Uri,%20int,
%20java.lang.String))
(/reference/android/net/Uri)
(/reference/java/lang/String)
If the calling process and user ID has not been granted permission to access
speci�c URI, throw
(/reference/java/lang/SecurityException).
(/reference/android/content/Context#enforcePermission(java.lang.String,%20
%20int,%20java.lang.String))
(/reference/java/lang/String)
(/reference/java/lang/String)
If the given permission is not allowed for a pa�icular process and user ID run
in the system, throw a
(/reference/java/lang/SecurityException).
(/reference/android/content/Context#enforceUriPermission(android.net.Uri,
%20java.lang.String,%20java.lang.String,%20int,%20int,%20int,
%20java.lang.String))
(/reference/android/net/Uri) (/reference/java/lang/String
(/reference/java/lang/String)
(/reference/java/lang/Stri
(/reference/android/content/Context#enforceUriPermission(android.net.Uri,
%20int,%20int,%20int,%20java.lang.String))
(/reference/android/net/Uri)
(/reference/java/lang/String)
If a pa�icular process and user ID has not been granted permission to access
speci�c URI, throw
(/reference/java/lang/SecurityException).
(/reference/java/lang/String)
(/reference/android/content/Context#�leList())
Returns an array of strings naming the private �les associated with this Conte
application package.
(/reference/android/content/Context)
(/reference/android/content/Context#getApplicationContext())
Return the context of the single, global Application object of the current proc
(/reference/android/content/pm/ApplicationInfo)
(/reference/android/content/Context#getApplicationInfo())
(/reference/android/content/res/AssetManager)
(/reference/android/content/Context#getAssets())
(/reference/android/content/A�ributionSource)
(/reference/android/content/Context#getA�ributionSource())
(/reference/java/lang/String)
(/reference/android/content/Context#getA�ributionTag
A�ribution can be used in complex apps to logically separate pa�s of the app
(/reference/java/io/File)
(/reference/android/content/Context#getCacheDir()
Returns the absolute path to the application speci�c cache directory on the
�lesystem.
(/reference/java/lang/ClassLoader)
(/reference/android/content/Context#getClassLoader()
Return a class loader you can use to retrieve classes in this package.
(/reference/java/io/File)
(/reference/android/content/Context#getCodeCacheDir()
Returns the absolute path to the application speci�c cache directory on the
�lesystem designed for storing cached code.
(/reference/android/content/Context#getColor(int))
Returns a color associated with a pa�icular resource ID and styled for the cu
theme.
(/reference/android/content/res/ColorStateList)
(/reference/android/content/Context#getColorStateList(int))
Returns a color state list associated with a pa�icular resource ID and styled f
the current theme.
(/reference/android/content/ContentResolver)
(/reference/android/content/Context#getContentResolver())
(/reference/java/io/File)
(/reference/android/content/Context#getDataDir())
Returns the absolute path to the directory on the �lesystem where all private
belonging to this app are stored.
(/reference/java/io/File)
(/reference/android/content/Context#getDatabasePath(java.lang.String)
(/reference/java/lang/String)
Returns the absolute path on the �lesystem where a database created with
(/reference/android/content/Context#openOrCreateDatabase(java.lang.Strin
%20int,%20android.database.sqlite.SQLiteDatabase.CursorFactory)
is stored.
(/reference/android/content/Context#getDeviceId()
(/reference/java/io/File)
(/reference/android/content/Context#getDir(java.lang.String,%20int)
(/reference/java/lang/String)
Retrieve, creating if needed, a new directory in which the application can plac
own custom data �les.
(/reference/android/view/Display)
(/reference/android/content/Context#getDisplay())
(/reference/android/graphics/drawable/Drawable)
(/reference/android/content/Context#getDrawable(int)
(/reference/java/io/File)
(/reference/android/content/Context#getExternalCacheDir())
(/reference/java/io/File)
(/reference/android/content/Context#getExternalCacheDirs())
(/reference/java/io/File)
(/reference/android/content/Context#getExternalFilesDir(java.lang.String)
(/reference/java/lang/String)
Returns the absolute path to the directory on the primary shared/external sto
device where the application can place persistent �les it owns.
(/reference/java/io/File)
(/reference/android/content/Context#getExternalFilesDirs(java.lang.String)
(/reference/java/lang/String)
(/reference/java/io/File)
(/reference/android/content/Context#getExternalMediaDirs())
This method was deprecated in API level 30. These directories still exist and a
scanned, but developers are encouraged to migrate to inse�ing content into
(/reference/android/provider/MediaStore) collection directly, as
app can contribute new media to
(/reference/android/provider/MediaStore) with no permissions required, sta�
in (/reference/android/os/Build.VERSION_CODES#
(/reference/java/io/File)
(/reference/android/content/Context#getFileStreamPath(java.lang.String)
(/reference/java/lang/String)
Returns the absolute path on the �lesystem where a �le created with
(/reference/android/content/Context#openFileOutput(java.lang.String,%20in
stored.
(/reference/java/io/File)
(/reference/android/content/Context#getFilesDir())
Returns the absolute path to the directory on the �lesystem where �les creat
with
(/reference/android/content/Context#openFileOutput(java.lang.String,%20in
are stored.
(/reference/java/util/concurrent/Executor)
(/reference/android/content/Context#getMainExecutor()
(/reference/android/os/Looper)
(/reference/android/content/Context#getMainLooper()
Return the Looper for the main thread of the current process.
(/reference/java/io/File)
(/reference/android/content/Context#getNoBackupFilesDir())
(/reference/java/io/File)
(/reference/android/content/Context#getObbDir())
(/reference/java/io/File)
(/reference/android/content/Context#getObbDirs())
(/reference/java/lang/String)
(/reference/android/content/Context#getOpPackageName())
(/reference/java/lang/String)
(/reference/android/content/Context#getPackageCodePath())
(/reference/android/content/pm/PackageManager)
(/reference/android/content/Context#getPackageManager())
(/reference/java/lang/String)
(/reference/android/content/Context#getPackageName()
(/reference/java/lang/String)
(/reference/android/content/Context#getPackageResourcePath()
(/reference/android/content/ContextParams)
(/reference/android/content/Context#getParams())
Return the set of parameters which this Context was created with, if it was
created via
(/reference/android/content/
Context#createContext(android.content.ContextParams))
.
(/reference/android/content/res/Resources)
(/reference/android/content/Context#getResources()
(/reference/android/content/SharedPreferences)
(/reference/android/content/Context#getSharedPreferences(java.lang.String
%20int))
(/reference/java/lang/String)
Retrieve and hold the contents of the preferences �le 'name', returning a
SharedPreferences through which you can retrieve and modify its values.
(/reference/java/lang/String)
(/reference/android/content/Context#getString(int))
Returns a localized string from the application's package's default string table
(/reference/java/lang/String)
(/reference/android/content/Context#getString(int,%20java.lang.Object[])
(/reference/java/lang/Object)
(/reference/android/content/Context#getSystemService(java.lang.Class<T>)
(/reference/java/lang/Class)
(/reference/java/lang/Object)
(/reference/android/content/Context#getSystemService(java.lang.String)
(/reference/java/lang/String)
(/reference/java/lang/String)
(/reference/android/content/Context#getSystemServiceName(java.lang.Class
>))
(/reference/java/lang/Class)
Gets the name of the system-level service that is represented by the speci�e
class.
(/reference/java/lang/CharSequence)
(/reference/android/content/Context#getText(int))
(/reference/android/content/res/Resources.Theme)
(/reference/android/content/Context#getTheme())
(/reference/android/graphics/drawable/Drawable)
(/reference/android/content/Context#getWallpaper()
(/reference/android/content/Context#getWallpaperDesiredMinimumHeight()
(/reference/android/app/WallpaperManager#getDesiredMinimumHeight()
instead.
(/reference/android/content/Context#getWallpaperDesiredMinimumWidth()
(/reference/android/app/WallpaperManager#getDesiredMinimumWidth()
instead.
(/reference/android/content/Context#grantUriPermission(java.lang.String,
%20android.net.Uri,%20int))
(/reference/java/lang/String)
(/reference/android/net/Uri)
(/reference/android/content/Context#isDeviceProtectedStorage()
(/reference/android/content/Context#isRestricted()
(/reference/android/content/Context#isUiContext()
as (/reference/android/view/WindowManager),
(/reference/android/view/LayoutIn�ater) or
(/reference/android/app/WallpaperManager
(/reference/android/content/
Context#moveDatabaseFrom(android.content.Context,%20java.lang.String)
(/reference/android/content/Context)
(/reference/java/lang/String)
Move an existing database �le from the given source storage context to this
context.
(/reference/android/content/
Context#moveSharedPreferencesFrom(android.content.Context,
%20java.lang.String))
(/reference/android/content/Context)
(/reference/java/lang/String)
Move an existing shared preferences �le from the given source storage conte
this context.
(/reference/android/content/res/TypedArray)
(/reference/android/content/
Context#obtainStyledA�ributes(android.util.A�ributeSet,%20int[])
(/reference/android/util/A�ributeSet)
(/reference/android/content/res/TypedArray)
(/reference/android/content/
Context#obtainStyledA�ributes(android.util.A�ributeSet,%20int[],%20int,
%20int))
(/reference/android/util/A�ributeSet)
(/reference/android/content/res/TypedArray)
(/reference/android/content/Context#obtainStyledA�ributes(int,%20int[])
(/reference/android/content/res/TypedArray)
(/reference/android/content/Context#obtainStyledA�ributes(int[])
(/reference/java/io/FileInputStream)
(/reference/android/content/Context#openFileInput(java.lang.String)
(/reference/java/lang/String)
Open a private �le associated with this Context's application package for rea
(/reference/java/io/FileOutputStream)
(/reference/android/content/Context#openFileOutput(java.lang.String,%20in
(/reference/java/lang/String)
Open a private �le associated with this Context's application package for writ
(/reference/android/database/sqlite/SQLiteDatabase)
(/reference/android/content/Context#openOrCreateDatabase(java.lang.Strin
%20int,%20android.database.sqlite.SQLiteDatabase.CursorFactory,
%20android.database.DatabaseErrorHandler))
(/reference/java/lang/String)
(/reference/android/database/sqlite/SQLiteDatabase.CursorFactory
(/reference/android/database/DatabaseErrorHand
(/reference/android/database/sqlite/SQLiteDatabase)
(/reference/android/content/Context#openOrCreateDatabase(java.lang.Strin
%20int,%20android.database.sqlite.SQLiteDatabase.CursorFactory)
(/reference/java/lang/String)
(/reference/android/database/sqlite/SQLiteDatabase.CursorFactory
(/reference/android/graphics/drawable/Drawable)
(/reference/android/content/Context#peekWallpaper()
(/reference/android/content/
Context#registerComponentCallbacks(android.content.ComponentCallbacks
(/reference/android/content/ComponentCallbacks
Add a new
(/reference/android/content/
Context#registerDeviceIdChangeListener(java.util.concurrent.Executor,
%20java.util.function.IntConsumer))
(/reference/java/util/concurrent/Executor)
(/reference/java/util/function/IntConsumer)
(/reference/android/content/Intent)
(/reference/android/content/
Context#registerReceiver(android.content.BroadcastReceiver,
%20android.content.IntentFilter))
(/reference/android/content/BroadcastReceiver
(/reference/android/content/IntentFilter
(/reference/android/content/Intent)
(/reference/android/content/
Context#registerReceiver(android.content.BroadcastReceiver,
%20android.content.IntentFilter,%20int))
(/reference/android/content/BroadcastReceiver
(/reference/android/content/IntentFilter
Register to receive intent broadcasts, with the receiver optionally being expos
to Instant Apps.
(/reference/android/content/Intent)
(/reference/android/content/
Context#registerReceiver(android.content.BroadcastReceiver,
%20android.content.IntentFilter,%20java.lang.String,%20android.os.Handler,
%20int))
(/reference/android/content/BroadcastReceiver
(/reference/android/content/IntentFilter
(/reference/java/lang/String)
(/reference/android/os/Handler)
(/reference/android/content/Intent)
(/reference/android/content/
Context#registerReceiver(android.content.BroadcastReceiver,
%20android.content.IntentFilter,%20java.lang.String,%20android.os.Handler)
(/reference/android/content/BroadcastReceiver
(/reference/android/content/IntentFilter
(/reference/java/lang/String)
(/reference/android/os/Handler)
(/reference/android/content/
Context#removeStickyBroadcast(android.content.Intent))
(/reference/android/content/Intent)
This method was deprecated in API level 21. Sticky broadcasts should not be
used. They provide no security (anyone can access them), no protection (any
can modify them), and many other problems. The recommended pa�ern is to
a non-sticky broadcast to repo� that something has changed, with another
mechanism for apps to retrieve the current value whenever desired.
(/reference/android/content/
Context#removeStickyBroadcastAsUser(android.content.Intent,
%20android.os.UserHandle))
(/reference/android/content/Intent)
(/reference/android/os/UserHandle)
This method was deprecated in API level 21. Sticky broadcasts should not be
used. They provide no security (anyone can access them), no protection (any
can modify them), and many other problems. The recommended pa�ern is to
a non-sticky broadcast to repo� that something has changed, with another
mechanism for apps to retrieve the current value whenever desired.
(/reference/android/content/
Context#revokeSelfPermissionOnKill(java.lang.String))
(/reference/java/lang/String)
(/reference/android/content/
Context#revokeSelfPermissionsOnKill(java.util.Collection<java.lang.String>)
(/reference/java/util/Collection)
(/reference/java/lang/String)
Triggers the revocation of one or more permissions for the calling package.
(/reference/android/content/Context#revokeUriPermission(android.net.Uri,
%20int))
(/reference/android/net/Uri)
Remove all permissions to access a pa�icular content provider Uri that were
previously added with
(/reference/android/content/Context#grantUriPermission(java.lang.String,
%20android.net.Uri,%20int))
or any other mechanism.
(/reference/android/content/Context#revokeUriPermission(java.lang.String,
%20android.net.Uri,%20int))
(/reference/java/lang/String)
(/reference/android/net/Uri)
(/reference/android/content/Context#sendBroadcast(android.content.Intent,
%20java.lang.String,%20android.os.Bundle))
(/reference/android/content/Intent)
(/reference/java/lang/String)
(/reference/android/os/Bundle)
(/reference/android/content/Context#sendBroadcast(android.content.Intent,
%20java.lang.String))
(/reference/android/content/Intent)
(/reference/java/lang/String)
(/reference/android/content/Context#sendBroadcast(android.content.Intent)
(/reference/android/content/Intent)
(/reference/android/content/
Context#sendBroadcastAsUser(android.content.Intent,
%20android.os.UserHandle))
(/reference/android/content/Intent)
(/reference/android/os/UserHandle)
Version of
(/reference/android/content/Context#sendBroadcast(android.content.Intent)
that allows you to specify the user the broadcast will be sent to.
(/reference/android/content/
Context#sendBroadcastAsUser(android.content.Intent,
%20android.os.UserHandle,%20java.lang.String))
(/reference/android/content/Intent)
(/reference/android/os/UserHandle) (/reference/java/lang/St
Version of
(/reference/android/content/Context#sendBroadcast(android.content.Intent,
%20java.lang.String))
that allows you to specify the user the broadcast will be sent to.
(/reference/android/content/
Context#sendBroadcastWithMultiplePermissions(android.content.Intent,
%20java.lang.String[]))
(/reference/android/content/Intent)
(/reference/java/lang/String)
(/reference/android/content/
Context#sendOrderedBroadcast(android.content.Intent,%20java.lang.String,
%20java.lang.String,%20android.content.BroadcastReceiver,
%20android.os.Handler,%20int,%20java.lang.String,%20android.os.Bundle)
(/reference/android/content/Intent)
(/reference/java/lang/String)
(/reference/java/lang/String)
(/reference/android/content/BroadcastReceiver)
(/reference/android/os/Handler)
(/reference/java/lang/String)
(/reference/android/os/Bundle)
Version of
(/reference/android/content/
Context#sendOrderedBroadcast(android.content.Intent,%20java.lang.String,
%20android.content.BroadcastReceiver,%20android.os.Handler,%20int,
%20java.lang.String,%20android.os.Bundle))
that allows you to specify the App Op to enforce restrictions on which receive
the broadcast will be sent to.
(/reference/android/content/
Context#sendOrderedBroadcast(android.content.Intent,%20java.lang.String,
%20android.content.BroadcastReceiver,%20android.os.Handler,%20int,
%20java.lang.String,%20android.os.Bundle))
(/reference/android/content/Intent)
(/reference/java/lang/String)
(/reference/android/content/BroadcastReceiver)
(/reference/android/os/Handler)
(/reference/java/lang/String)
(/reference/android/os/Bundle)
Version of
(/reference/android/content/Context#sendBroadcast(android.content.Intent)
that allows you to receive data back from the broadcast.
(/reference/android/content/
Context#sendOrderedBroadcast(android.content.Intent,%20java.lang.String,
%20android.os.Bundle))
(/reference/android/content/Intent)
(/reference/java/lang/String)
(/reference/android/os/Bundle)
(/reference/android/content/
Context#sendOrderedBroadcast(android.content.Intent,%20java.lang.String,
%20android.os.Bundle,%20android.content.BroadcastReceiver,
%20android.os.Handler,%20int,%20java.lang.String,%20android.os.Bundle)
(/reference/android/content/Intent)
(/reference/java/lang/String)
(/reference/android/os/Bundle)
(/reference/android/content/BroadcastReceiver)
(/reference/android/os/Handler)
(/reference/java/lang/String)
(/reference/android/os/Bundle)
Version of
(/reference/android/content/Context#sendBroadcast(android.content.Intent)
that allows you to receive data back from the broadcast.
(/reference/android/content/
Context#sendOrderedBroadcast(android.content.Intent,%20java.lang.String)
(/reference/android/content/Intent)
(/reference/java/lang/String)
(/reference/android/content/
Context#sendOrderedBroadcastAsUser(android.content.Intent,
%20android.os.UserHandle,%20java.lang.String,
%20android.content.BroadcastReceiver,%20android.os.Handler,%20int,
%20java.lang.String,%20android.os.Bundle))
(/reference/android/content/Intent)
(/reference/android/os/UserHandle) (/reference/java/lang/St
(/reference/android/content/BroadcastReceiver)
(/reference/android/os/Handler)
(/reference/java/lang/String)
(/reference/android/os/Bundle)
Version of
(/reference/android/content/
Context#sendOrderedBroadcast(android.content.Intent,%20java.lang.String,
%20android.content.BroadcastReceiver,%20android.os.Handler,%20int,
%20java.lang.String,%20android.os.Bundle))
that allows you to specify the user the broadcast will be sent to.
(/reference/android/content/
Context#sendStickyBroadcast(android.content.Intent))
(/reference/android/content/Intent)
This method was deprecated in API level 21. Sticky broadcasts should not be
used. They provide no security (anyone can access them), no protection (any
can modify them), and many other problems. The recommended pa�ern is to
a non-sticky broadcast to repo� that something has changed, with another
mechanism for apps to retrieve the current value whenever desired.
(/reference/android/content/
Context#sendStickyBroadcast(android.content.Intent,%20android.os.Bundle)
(/reference/android/content/Intent)
(/reference/android/os/Bundle)
This method was deprecated in API level 31. Sticky broadcasts should not be
used. They provide no security (anyone can access them), no protection (any
can modify them), and many other problems. The recommended pa�ern is to
a non-sticky broadcast to repo� that something has changed, with another
mechanism for apps to retrieve the current value whenever desired.
(/reference/android/content/
Context#sendStickyBroadcastAsUser(android.content.Intent,
%20android.os.UserHandle))
(/reference/android/content/Intent)
(/reference/android/os/UserHandle)
This method was deprecated in API level 21. Sticky broadcasts should not be
used. They provide no security (anyone can access them), no protection (any
can modify them), and many other problems. The recommended pa�ern is to
(/reference/android/content/
Context#sendStickyOrderedBroadcast(android.content.Intent,
%20android.content.BroadcastReceiver,%20android.os.Handler,%20int,
%20java.lang.String,%20android.os.Bundle))
(/reference/android/content/Intent)
(/reference/android/content/BroadcastReceiver)
(/reference/android/os/Handler)
(/reference/java/lang/String)
(/reference/android/os/Bundle)
This method was deprecated in API level 21. Sticky broadcasts should not be
used. They provide no security (anyone can access them), no protection (any
can modify them), and many other problems. The recommended pa�ern is to
a non-sticky broadcast to repo� that something has changed, with another
mechanism for apps to retrieve the current value whenever desired.
(/reference/android/content/
Context#sendStickyOrderedBroadcastAsUser(android.content.Intent,
%20android.os.UserHandle,%20android.content.BroadcastReceiver,
%20android.os.Handler,%20int,%20java.lang.String,%20android.os.Bundle)
(/reference/android/content/Intent)
(/reference/android/os/UserHandle)
(/reference/android/content/BroadcastReceiver)
(/reference/android/os/Handler)
(/reference/java/lang/String)
(/reference/android/os/Bundle)
This method was deprecated in API level 21. Sticky broadcasts should not be
used. They provide no security (anyone can access them), no protection (any
can modify them), and many other problems. The recommended pa�ern is to
a non-sticky broadcast to repo� that something has changed, with another
mechanism for apps to retrieve the current value whenever desired.
(/reference/android/content/Context#setTheme(int))
(/reference/android/content/Context#setWallpaper(android.graphics.Bitmap)
(/reference/android/graphics/Bitmap)
(/reference/android/Manifest.permission#SET_WALLPAPER).
(/reference/android/content/Context#setWallpaper(java.io.InputStream)
(/reference/java/io/InputStream)
(/reference/android/Manifest.permission#SET_WALLPAPER).
(/reference/android/content/Context#sta�Activities(android.content.Intent[],
%20android.os.Bundle))
(/reference/android/content/Intent)
(/reference/android/os/Bundle)
(/reference/android/content/Context#sta�Activities(android.content.Intent[])
(/reference/android/content/Intent)
Same as
(/reference/android/content/Context#sta�Activities(android.content.Intent[],
%20android.os.Bundle))
with no options speci�ed.
(/reference/android/content/Context#sta�Activity(android.content.Intent)
(/reference/android/content/Intent)
Same as
(/reference/android/content/Context#sta�Activity(android.content.Intent,
%20android.os.Bundle))
with no options speci�ed.
(/reference/android/content/Context#sta�Activity(android.content.Intent,
%20android.os.Bundle))
(/reference/android/content/Intent)
(/reference/android/os/Bundle)
(/reference/android/content/ComponentName)
(/reference/android/content/
Context#sta�ForegroundService(android.content.Intent))
(/reference/android/content/Intent)
Similar to
(/reference/android/content/Context#sta�Service(android.content.Intent)
with an implicit promise that the Service will call
(/reference/android/app/Service#sta�Foreground(int,
%20android.app.Noti�cation))
once it begins running.
(/reference/android/content/
Context#sta�Instrumentation(android.content.ComponentName,
%20java.lang.String,%20android.os.Bundle))
(/reference/android/content/ComponentName)
(/reference/java/lang/String)
(/reference/android/os/Bundle)
(/reference/android/content/
Context#sta�IntentSender(android.content.IntentSender,
%20android.content.Intent,%20int,%20int,%20int))
(/reference/android/content/IntentSender)
(/reference/android/content/Intent)
Same as
(/reference/android/content/
Context#sta�IntentSender(android.content.IntentSender,
%20android.content.Intent,%20int,%20int,%20int,%20android.os.Bundle)
with no options speci�ed.
(/reference/android/content/
Context#sta�IntentSender(android.content.IntentSender,
%20android.content.Intent,%20int,%20int,%20int,%20android.os.Bundle)
(/reference/android/content/IntentSender)
(/reference/android/content/Intent)
(/reference/android/os/Bundle
Like
(/reference/android/content/Context#sta�Activity(android.content.Intent,
%20android.os.Bundle))
, but taking a IntentSender to sta�.
(/reference/android/content/ComponentName)
(/reference/android/content/Context#sta�Service(android.content.Intent)
(/reference/android/content/Intent)
(/reference/android/content/Context#stopService(android.content.Intent)
(/reference/android/content/Intent)
(/reference/android/content/
Context#unbindService(android.content.ServiceConnection))
(/reference/android/content/ServiceConnection
(/reference/android/content/
Context#unregisterComponentCallbacks(android.content.ComponentCallbac
(/reference/android/content/ComponentCallbacks
Remove a
(/reference/android/content/ComponentCallbacks) object that was previously
registered with
(/reference/android/content/
Context#registerComponentCallbacks(android.content.ComponentCallbacks
.
(/reference/android/content/
Context#unregisterDeviceIdChangeListener(java.util.function.IntConsumer)
(/reference/java/util/function/IntConsumer)
(/reference/android/content/
Context#unregisterReceiver(android.content.BroadcastReceiver)
(/reference/android/content/BroadcastReceiver
(/reference/android/content/
Context#updateServiceGroup(android.content.ServiceConnection,%20int,
%20int))
(/reference/android/content/ServiceConnection
(/reference/android/content/Context#bindService(android.content.Intent,
%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Execu
%20android.content.ServiceConnection))
or a related method, change how the system manages that service's process
relation to other processes.
(/reference/java/lang/Object#equals(java.lang.Object)) (/reference/java/lang/Object)
(/reference/java/lang/Object#�nalize())
Called by the garbage collector on an object when garbage collection determines that there are no more reference
the object.
(/reference/java/lang/Class)
(/reference/java/lang/Object#getClass())
(/reference/java/lang/Object#hashCode())
(/reference/java/lang/Object#notify())
(/reference/java/lang/Object#notifyAll())
(/reference/java/lang/String)
(/reference/java/lang/Object#toString())
(/reference/java/lang/Object#wait(long,%20int))
Causes the current thread to wait until it is awakened, typically by being noti�ed or interrupted, or until a ce�ain
amount of real time has elapsed.
(/reference/java/lang/Object#wait(long))
Causes the current thread to wait until it is awakened, typically by being noti�ed or interrupted, or until a ce�ain
amount of real time has elapsed.
(/reference/java/lang/Object#wait())
Causes the current thread to wait until it is awakened, typically by being noti�ed or interrupted.
Called when the operating system has determined that it is a good time for a process to trim unneeded memory from its proces
(/reference/android/content/ComponentCallbacks#onCon�gurationChanged(android.content.res.Con�guration))
(/reference/android/content/res/Con�guration)
Called by the system when the device con�guration changes while your component is running.
(/reference/android/content/ComponentCallbacks#onLowMemory())
This is called when the overall system is running low on memory, and actively running processes should trim their memory usage
Parameters
Unless you provide binding for your service, you don't need to implement this method, because the default implementation returns
null.
Parameters
Returns
See also:
(/reference/android/app/Service#onBind(android.content.Intent))
Called by the system when the service is �rst created. Do not call this method directly.
Called by the system to notify a Service that it is no longer used and is being removed. The service should clean up any resources it
holds (threads, registered receivers, etc) at this point. Upon return, there will be no more calls in to this Service object and it is
e�ectively dead. Do not call this method directly.
Parameters
You should not override this method for your IntentService. Instead, override
(/reference/android/app/IntentService#onHandleIntent(android.content.Intent)) , which the system calls when the IntentService receives a
sta� request.
Parameters
Returns
The return value indicates what semantics the system should use for the service's current sta�ed state. It may be
one of the constants associated with the
(/reference/android/app/Service#START_CONTINUATION_MASK) bits. Value is
(/reference/android/app/Service#START_STICKY_COMPATIBILITY),
(/reference/android/app/Service#START_STICKY),
(/reference/android/app/Service#START_NOT_STICKY), or
(/reference/android/app/Service#START_REDELIVER_INTENT)
See also:
(/reference/android/app/Service#onSta�Command(android.content.Intent,%20int,%20int))
Sets intent redelivery preferences. Usually called from the constructor with your preferred semantics.
If enabled is true,
(/reference/android/app/IntentService#onSta�Command(android.content.Intent,%20int,%20int)) will return
(/reference/android/app/Service#START_REDELIVER_INTENT) , so if this process dies before
(/reference/android/app/IntentService#onHandleIntent(android.content.Intent)) returns, the process will be resta�ed and the intent
redelivered. If multiple Intents have been sent, only the most recent one is guaranteed to be redelivered.
Parameters
This method is invoked on the worker thread with a request to process. Only one Intent is processed at a time, but the processing
happens on a worker thread that runs independently from other application logic. So, if this code takes a long time, it will hold up
other requests to the same IntentService, but it will not hold up anything else. When all requests have been handled, the
IntentService stops itself, so you should not call (/reference/android/app/Service#stopSelf()) .
This method may take several seconds to complete, so it should only be called from a worker thread.
Parameters
Content and code samples on this page are subject to the licenses described in the Content License (/license). Java and OpenJDK are trademarks or registered
trademarks of Oracle and/or its a�liates.