系统之家提供 Windows 系统、Ghost 系统、驱动与常用软件的安全下载及安装教程。 后台管理
📢 欢迎访问系统之家!所有资源均经过安全检测。

Application

发布时间:2026-09-17 | 浏览:1
📥 下载地址(文章开头)
装机神器,可安装一切系统,纯净版,英文版,繁体版 ,精简版,原版等等等
Español – América Latina Português – Brasil Android Developers public class Application extends ContextWrapper implements ComponentCallbacks2 Base class for maintaining global application state. You can provide your own implementation by creating a subclass and specifying the fully-qualified name of this subclass as the "android:name" attribute in your AndroidManifest.xml's <application> tag. The Application class, or your subclass of the Application class, is instantiated before any other class when the process for your application/package is created. Note: There is normally no need to subclass Application. In most situations, static singletons can provide the same functionality in a more modular way. If your singleton needs a global context (for example to register broadcast receivers), include Context.getApplicationContext() as a Context argument when invoking your singleton's getInstance() method. Note: There is normally no need to subclass Application. In most situations, static singletons can provide the same functionality in a more modular way. If your singleton needs a global context (for example to register broadcast receivers), include Context.getApplicationContext() as a Context argument when invoking your singleton's getInstance() method. Callback interface for use with Application.registerOnProvideAssistDataListener and Application.unregisterOnProvideAssistDataListener . Inherited constants Use with getSystemService(String) to retrieve a AccessibilityManager for giving the user feedback for UI events through the registered event listeners. Use with getSystemService(String) to retrieve a AccountManager for receiving intents at a time of your choosing. Use with getSystemService(String) to retrieve a ActivityManager for interacting with the global system state. Use with getSystemService(String) to retrieve an AdvancedProtectionManager Use with getSystemService(String) to retrieve a AlarmManager for receiving intents at a time of your choosing. Use with getSystemService(String) to retrieve a AppWidgetManager for accessing AppWidgets. Use with getSystemService(String) to retrieve an AppFunctionManager for executing app functions. Use with getSystemService(String) to retrieve an AppInteractionManager for managing app interactions. Use with getSystemService(String) to retrieve a AppOpsManager for tracking application operations on the device. Use with getSystemService(String) to retrieve an AppSearchManager for indexing and querying app data managed by the system. Use with getSystemService(String) to retrieve a AudioManager for handling management of volume, ringer modes and audio routing. Use with getSystemService(String) to retrieve an AuthenticationPolicyManager . Use with getSystemService(String) to retrieve an AutofillManager . Use with getSystemService(String) to retrieve a BatteryManager for managing battery state. Flag for bindService(Intent, BindServiceFlags, Executor, ServiceConnection) : indicates that the client application binding to this service considers the service to be more important than the app itself. Flag for bindService(Intent, BindServiceFlags, Executor, ServiceConnection) : If binding from an activity, allow the target service's process importance to be raised based on whether the activity is visible to the user, regardless whether another flag is used to reduce the amount that the client process's overall importance is used to impact it. Flag for bindService(Intent, BindServiceFlags, Executor, ServiceConnection) : If binding from an app that is visible, the bound service is allowed to start an activity from background. Flag for bindService(Intent, BindServiceFlags, Executor, ServiceConnection) : allow the process hosting the bound service to go through its normal memory management. Flag for bindService(Intent, BindServiceFlags, Executor, ServiceConnection) : automatically create the service as long as the binding exists. Flag for bindService(Intent, BindServiceFlags, Executor, ServiceConnection) : include debugging help for mismatched calls to unbind. Flag for bindService(Intent, BindServiceFlags, Executor, ServiceConnection) : The service being bound is an isolated , external service. Works in the same way as BIND_EXTERNAL_SERVICE , but it's defined as a long value that is compatible to BindServiceFlags . Flag for bindService(Intent, BindServiceFlags, Executor, ServiceConnection) : this service is very important to the client, so should be brought to the foreground process level when the client is. Flag for bindService(Intent, BindServiceFlags, Executor, ServiceConnection) : If binding from an app that has specific capabilities due to its foreground state such as an activity or foreground service, then this flag will allow the bound app to get the same capabilities, as long as it has the required permissions as well. Flag for bindService(Intent, BindServiceFlags, Executor, ServiceConnection) : don't allow this binding to raise the target service's process to the foreground scheduling priority. Flag for bindService(Intent, BindServiceFlags, Executor, ServiceConnection) : If binding from an app that is visible or user-perceptible, lower the target service's importance to below the perceptible level. Flag for bindIsolatedService(Intent, BindServiceFlags, String, Executor, ServiceConnection) : Bind the service into a shared isolated process, but only with other isolated services from the same package that declare the same process name. Flag for bindIsolatedService(Intent, BindServiceFlags, String, Executor, ServiceConnection) : Bind the service into a shared isolated process. Flag for bindService(Intent, BindServiceFlags, Executor, ServiceConnection) : don't impact the scheduling or memory management priority of the target service's hosting process. Use with getSystemService(String) to retrieve a BiometricManager for handling biometric and PIN/pattern/password authentication. Use with getSystemService(String) to retrieve a BlobStoreManager for contributing and accessing data blobs from the blob store maintained by the system. Use with getSystemService(String) to retrieve a BluetoothManager for using Bluetooth. Service to capture a bugreport. Use with getSystemService(String) to retrieve a CameraManager for interacting with camera devices. Use with getSystemService(String) to retrieve a CaptioningManager for obtaining captioning properties and listening for changes in captioning preferences. Use with getSystemService(String) to retrieve a CarrierConfigManager for reading carrier configuration values. Use with getSystemService(String) to retrieve a ChooserManager . Use with getSystemService(String) to retrieve a ClipboardManager for accessing and modifying the contents of the global clipboard. Use with getSystemService(String) to retrieve a CompanionDeviceManager for managing companion devices Use with getSystemService(String) to retrieve a ConnectivityDiagnosticsManager for performing network connectivity diagnostics as well as receiving network connectivity information from the system. Use with getSystemService(String) to retrieve a ConnectivityManager for handling management of network connections. Use with getSystemService(String) to retrieve a ConsumerIrManager for transmitting infrared signals from the device. Use with getSystemService(String) to retrieve a E2eeContactKeysManager to managing contact keys. Use with getSystemService(String) to retrieve a ContentSafetyManager . Flag for use with createPackageContext(String, int) : ignore any security restrictions on the Context being requested, allowing it to always be loaded. Flag for use with createPackageContext(String, int) : include the application code with the context. Flag for use with createPackageContext(String, int) : a restricted context may disable specific features. Use with getSystemService(String) to retrieve a CredentialManager to authenticate a user to your app. Use with getSystemService(String) to retrieve a CrossProfileApps for cross profile operations. The default device ID, which is the ID of the primary (non-virtual) device. Invalid device ID. Use with getSystemService(String) to retrieve a DeviceLockManager . Use with getSystemService(String) to retrieve a DevicePolicyManager for working with global device policy management. Use with getSystemService(String) to access DisplayHashManager to handle display hashes. Use with getSystemService(String) to retrieve a DisplayManager for interacting with display devices. Use with getSystemService(String) to access DomainVerificationManager to retrieve approval and user state for declared web domains. Use with getSystemService(String) to retrieve a DownloadManager for requesting HTTP downloads. Use with getSystemService(String) to retrieve a DropBoxManager instance for recording diagnostic logs. Use with getSystemService(String) to retrieve a EuiccManager to manage the device eUICC (embedded SIM). Use with getSystemService(String) to retrieve an FileIntegrityManager . Use with getSystemService(String) to retrieve a FileManager for handling file operations. Use with getSystemService(String) to retrieve a GameManager . Use with getSystemService(String) to retrieve a GrammaticalInflectionManager . Use with getSystemService(String) to retrieve a HardwarePropertiesManager for accessing the hardware properties service. Use with getSystemService(String) to retrieve a HealthConnectManager . Use with getSystemService(String) to retrieve a HidManager for interacting with HID devices. Use with getSystemService(String) to retrieve a InputMethodManager for accessing input methods. Use with getSystemService(String) to retrieve a InputManager for interacting with input devices. Use with getSystemService(String) to retrieve a IpSecManager for encrypting Sockets or Networks with IPSec. Use with getSystemService(String) to retrieve a JobScheduler instance for managing occasional background tasks. Use with getSystemService(String) to retrieve a KeyChainManager for managing KeyChain certificates and grants. Use with getSystemService(String) to retrieve a KeyguardManager for controlling keyguard. Use with getSystemService(String) to retrieve a KeyStoreManager for accessing Android Keystore functions. Use with getSystemService(String) to retrieve a LauncherApps for querying and monitoring launchable apps across profiles of a user. Use with getSystemService(String) to retrieve a LayoutInflater for inflating layout resources in this context. Use with getSystemService(String) to retrieve a LocaleManager . Use with getSystemService(String) to retrieve a LocationManager for controlling location updates. Use with getSystemService(String) to retrieve a MediaCommunicationManager for managing MediaSession2 . Use with getSystemService(String) to retrieve a MediaMetricsManager for interacting with media metrics on the device. Use with getSystemService(String) to retrieve a MediaProjectionManager instance for managing media projection sessions. Use with getSystemService(String) to retrieve a MediaQualityManager for standardize picture and audio API parameters. Use with getSystemService(Class) to retrieve a MediaRouter for controlling and managing routing of media. Use with getSystemService(String) to retrieve a MediaSessionManager for managing media Sessions. Use with getSystemService(String) to retrieve a MemoryBudgetManager for monitoring memory budgets. Use with getSystemService(String) to retrieve a MidiManager for accessing the MIDI service. File creation mode: for use with openFileOutput(String, int) , if the file already exists then write data to the end of the existing file instead of erasing it. Database open flag: when set, the database is opened with write-ahead logging enabled by default. This constant was deprecated in API level 23. MODE_MULTI_PROCESS does not work reliably in some versions of Android, and furthermore does not provide any mechanism for reconciling concurrent modifications across processes. Applications should not attempt to use it. Instead, they should use an explicit cross-process data management approach such as ContentProvider . Database open flag: when set, the database is opened without support for localized collators. File creation mode: the default mode, where the created file can only be accessed by the calling application (or all applications sharing the same user ID). This constant was deprecated in API level 17. Creating world-readable files 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 ContentProvider , BroadcastReceiver , and Service . There are no guarantees that this access mode will remain on a file, such as when it goes through a backup and restore. This constant was deprecated in API level 17. Creating world-writable files 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 ContentProvider , BroadcastReceiver , and Service . There are no guarantees that this access mode will remain on a file, such as when it goes through a backup and restore. Use with getSystemService(String) to retrieve the service that plays multisensory feedback. Use with getSystemService(String) to retrieve a NetworkStatsManager for querying network usage stats. Use with getSystemService(String) to retrieve a NfcManager for using NFC. Use with getSystemService(String) to retrieve a NotificationManager for informing the user of background events. Use with getSystemService(String) to retrieve a ERROR(/android.npumanager.NpuManager) . Use with getSystemService(String) to retrieve a NsdManager for handling management of network service discovery Use with getSystemService(String) to retrieve a OverlayManager for managing overlay packages. Use with getSystemService(String) to retrieve a PccSandboxManager . Use with getSystemService(String) to access a PeopleManager to interact with your published conversations. Use with getSystemService(String) to retrieve a PerformanceHintManager for accessing the performance hinting service. Use with getSystemService(String) to retrieve a PersistentDataBlockManager instance for interacting with a storage device that lives across factory resets. Use with getSystemService(String) to retrieve a PowerManager for controlling power management, including "wake locks," which let you keep the device on while you're running long tasks. PrintManager for printing and managing printers and print tasks. Use with getSystemService(String) to retrieve an ProfilingManager . Flag for registerReceiver(BroadcastReceiver, IntentFilter) : The receiver can receive broadcasts from other Apps. Flag for registerReceiver(BroadcastReceiver, IntentFilter) : The receiver cannot receive broadcasts from other Apps. Flag for registerReceiver(BroadcastReceiver, IntentFilter) : The receiver can receive broadcasts from Instant Apps. Use with getSystemService(String) to retrieve a RestrictionsManager for retrieving application restrictions and requesting permissions for restricted operations. Use with getSystemService(String) to retrieve a RoleManager for managing roles. Use with getSystemService(String) to retrieve a SatelliteManager for accessing satellite functionality. Use with getSystemService(String) to retrieve a SearchManager for handling searches. Use with getSystemService(String) to retrieve a SecurityStateManager for accessing the security state manager service. Use with getSystemService(String) to retrieve a SensorManager for accessing sensors. Use with getSystemService(String) to retrieve a SerialManager for access to serial ports. Use with getSystemService(String) to retrieve a ShortcutManager for accessing the launcher shortcut service. Use with getSystemService(String) to retrieve a StatusBarManager for interacting with the status bar and quick settings. Use with getSystemService(String) to retrieve a StorageManager for accessing system storage functions. Use with getSystemService(String) to retrieve a StorageStatsManager for accessing system storage statistics. Use with getSystemService(String) to retrieve a SystemHealthManager for accessing system health (battery, power, memory, etc) metrics. Use with getSystemService(String) to retrieve a TelecomManager to manage telecom-related features of the device. Use with getSystemService(String) to retrieve an ImsManager . Use with getSystemService(String) to retrieve a PhoneNumberManager for parsing phone numbers. Use with getSystemService(String) to retrieve a TelephonyManager for handling management the telephony features of the device. Use with getSystemService(String) to retrieve a SubscriptionManager for handling management the telephony subscriptions of the device. Use with getSystemService(String) to retrieve a TetheringManager for managing tethering functions. Use with getSystemService(String) to retrieve a TextClassificationManager for text classification services. Use with getSystemService(String) to retrieve a TextServicesManager for accessing text services. Use with getSystemService(String) to retrieve a TimeManager . Use with getSystemService(String) to retrieve a TvAdManager for interacting with TV client-side advertisement services on the device. Use with getSystemService(String) to retrieve a TvInputManager for interacting with TV inputs on the device. Use with getSystemService(String) to retrieve a TvInteractiveAppManager for interacting with TV interactive applications on the device. Use with getSystemService(String) to retrieve a UiModeManager for controlling UI modes. Use with getSystemService(String) to retrieve a UsageStatsManager for querying device usage stats. Use with getSystemService(String) to retrieve a UsbManager for access to USB devices (as a USB host) and for controlling this device's behavior as a USB device. Use with getSystemService(String) to retrieve a UserManager for managing users on devices that support multiple users. Use with getSystemService(String) to retrieve a VibratorManager for accessing the device vibrators, interacting with individual ones and playing synchronized effects on multiple vibrators. This constant was deprecated in API level 31. Use VibratorManager to retrieve the default system vibrator. Use with getSystemService(String) to retrieve a VirtualDeviceManager for managing virtual devices. Use with getSystemService(String) to retrieve a VpnManager to manage profiles for the platform built-in VPN. Use with getSystemService(String) to retrieve a com.android.server.WallpaperService for accessing wallpapers. Use with getSystemService(String) to retrieve a WebAppManager . Use with getSystemService(String) to retrieve a WifiAwareManager for handling management of Wi-Fi Aware. Use with getSystemService(String) to retrieve a WifiP2pManager for handling management of Wi-Fi peer-to-peer connections. Use with getSystemService(String) to retrieve a WifiRttManager for ranging devices with wifi. Use with getSystemService(String) to retrieve a WifiManager for handling management of Wi-Fi access. Use with getSystemService(String) to retrieve a WindowManager for accessing the system's window manager. Level for onTrimMemory(int) : the process has gone on to the LRU list. This constant was deprecated in API level 35. Apps are not notified of this level since API level 34 This constant was deprecated in API level 35. Apps are not notified of this level since API level 34 This constant was deprecated in API level 35. Apps are not notified of this level since API level 34 This constant was deprecated in API level 35. Apps are not notified of this level since API level 34 This constant was deprecated in API level 35. Apps are not notified of this level since API level 34 Level for onTrimMemory(int) : the process had been showing a user interface, and is no longer doing so. Public constructors Returns the name of the current process. Called by the system when the device configuration changes while your component is running. If you override this method you must call through to the superclass implementation. Called when the application is starting, before any activity, service, or receiver objects (excluding content providers) have been created. This is called when the overall system is running low on memory, and actively running processes should trim their memory usage. If you override this method you must call through to the superclass implementation. This method is for use in emulated process environments. Called when the operating system has determined that it is a good time for a process to trim unneeded memory from its process. If you override this method you must call through to the superclass implementation. Add a new ComponentCallbacks to the base application of the Context, which will be called at the same times as the ComponentCallbacks methods of activities and other components are called. Remove a ComponentCallbacks object that was previously registered with registerComponentCallbacks(ComponentCallbacks) . Inherited methods Set the base context for this ContextWrapper. Variation of bindService(Intent, BindServiceFlags, Executor, ServiceConnection) that, in the specific case of isolated services, allows the caller to generate multiple instances of a service from a single component declaration. Same as bindService(Intent, ServiceConnection, int) with executor to control ServiceConnection callbacks. See bindService(Intent,ServiceConnection,int) Call BindServiceFlags.of(long) to obtain a BindServiceFlags object. Connects to an application service, creating it if needed. See bindService(Intent,int,Executor,ServiceConnection) Call BindServiceFlags.of(long) to obtain a BindServiceFlags object. Binds to a service in the given user in the same manner as bindService(Intent, BindServiceFlags, Executor, ServiceConnection) . See bindServiceAsUser(Intent,ServiceConnection,int,UserHandle) Call BindServiceFlags.of(long) to obtain a BindServiceFlags object. Determine whether the calling process of an IPC or you have been granted a particular permission. Determine whether the calling process of an IPC or you has been granted permission to access a specific URI. Determine whether the calling process of an IPC or you has been granted permission to access a list of URIs. Determine whether the calling process of an IPC you are handling has been granted a particular permission. Determine whether the calling process and uid has been granted permission to access a specific URI. Determine whether the calling process and uid has been granted permission to access a list of URIs. Determine whether a particular process and uid has been granted permission to access a specific content URI. Determine whether the given permission is allowed for a particular process and user ID running in the system. Determine whether you have been granted a particular permission. Check both a Uri and normal permission. Determine whether a particular process and uid has been granted permission to access a specific URI. Determine whether a particular process and uid has been granted permission to access a list of URIs. This method is deprecated. Use WallpaperManager.clear() instead. This method requires the caller to hold the permission Manifest.permission.SET_WALLPAPER . This method requires the caller to hold the permission Manifest.permission.SET_WALLPAPER . Return a new Context object for the current Context but attribute to a different tag. Return a new Context object for the current Context but whose resources are adjusted to match the given Configuration. Creates a context with specific properties and behaviors. Return a new Context object for the given split name. Returns a new Context object from the current context but with device association given by the deviceId . Return a new Context object for the current Context but whose storage APIs are backed by device-protected storage. Returns a new Context object from the current context but with resources adjusted to match the metrics of display . Return a new Context object for the given application name. Creates a Context for a non-activity window. Creates a Context for a non- activity window on the given Display . Returns an array of strings naming the private databases associated with this Context's application package. Delete an existing private SQLiteDatabase associated with this Context's application package. Delete the given private file associated with this Context's application package. Delete an existing shared preferences file. If neither you nor the calling process of an IPC you are handling has been granted a particular permission, throw a SecurityException . If the calling process of an IPC or you has not been granted permission to access a specific URI, throw SecurityException . If the calling process of an IPC you are handling has not been granted a particular permission, throw a SecurityException . If the calling process and uid has not been granted permission to access a specific URI, throw SecurityException . If the given permission is not allowed for a particular process and user ID running in the system, throw a SecurityException . Enforce both a Uri and normal permission. If a particular process and uid has not been granted permission to access a specific URI, throw SecurityException . Returns an array of strings naming the private files associated with this Context's application package. Return the context of the single, global Application object of the current process. Return the full application info for this context's package. Returns an AssetManager instance for the application's package. Attribution can be used in complex apps to logically separate parts of the app. Attribution can be used in complex apps to logically separate parts of the app. Returns the absolute path to the application specific cache directory on the filesystem. Return a class loader you can use to retrieve classes in this package. Returns the absolute path to the application specific cache directory on the filesystem designed for storing cached code. Return a ContentResolver instance for your application's package. Returns the absolute path to the directory on the filesystem where all private files belonging to this app are stored. Returns the absolute path on the filesystem where a database created with openOrCreateDatabase(String, int, CursorFactory) is stored. Gets the device ID this context is associated with. Retrieve, creating if needed, a new directory in which the application can place its own custom data files. Get the display this context is associated with. Returns absolute path to application-specific directory on the primary shared/external storage device where the application can place cache files it owns. Returns absolute paths to application-specific directories on all shared/external storage devices where the application can place cache files it owns. Returns the absolute path to the directory on the primary shared/external storage device where the application can place persistent files it owns. Returns absolute paths to application-specific directories on all shared/external storage devices where the application can place persistent files it owns. This method is deprecated. These directories still exist and are scanned, but developers are encouraged to migrate to inserting content into a MediaStore collection directly, as any app can contribute new media to MediaStore with no permissions required, starting in Build.VERSION_CODES.Q . Returns the absolute path on the filesystem where a file created with openFileOutput(String, int) is stored. Returns the absolute path to the directory on the filesystem where files created with openFileOutput(String, int) are stored. Return an Executor that will run enqueued tasks on the main thread associated with this context. Return the Looper for the main thread of the current process. Returns the absolute path to the directory on the filesystem similar to getFilesDir() . Return the primary shared/external storage directory where this application's OBB files (if there are any) can be found. Returns absolute paths to application-specific directories on all shared/external storage devices where the application's OBB files (if there are any) can be found. Return the package name that should be used for AppOpsManager calls from this context, so that app ops manager's uid verification will work with the name. Return the full path to this context's primary Android package. Return PackageManager instance to find global package information. Return the name of this application's package. Return the full path to this context's primary Android package. Return the set of parameters which this Context was created with, if it was created via createContext(ContextParams) . Returns a Resources instance for the application's package. Retrieve and hold the contents of the preferences file 'name', returning a SharedPreferences through which you can retrieve and modify its values. Return the handle to a system-level service by name. Gets the name of the system-level service that is represented by the specified class. Return the Theme object associated with this Context. This method is deprecated. Use WallpaperManager.get() instead. This method is deprecated. Use WallpaperManager.getDesiredMinimumHeight() instead. This method is deprecated. Use WallpaperManager.getDesiredMinimumWidth() instead. Grant permission to access a specific Uri to another package, regardless of whether that package has general permission to access the Uri's content provider. Indicates if the storage APIs of this Context are backed by device-protected storage. Indicates whether this Context is restricted. Returns true if the context is a UI context which can access UI components such as WindowManager , LayoutInflater or WallpaperManager . Move an existing database file from the given source storage context to this context.
📥 下载地址(文章中间)
装机神器,可安装一切系统,纯净版,英文版,繁体版 ,精简版,原版等等等
Move an existing shared preferences file from the given source storage context to this context. Open a private file associated with this Context's application package for reading. Open a private file associated with this Context's application package for writing. Open a new private SQLiteDatabase associated with this Context's application package. Open a new private SQLiteDatabase associated with this Context's application package. This method is deprecated. Use WallpaperManager.peek() instead. Rebind an application service with updated bind service flags Add a new ComponentCallbacks to the base application of the Context, which will be called at the same times as the ComponentCallbacks methods of activities and other components are called. Adds a new device ID changed listener to the Context , which will be called when the device association is changed by the system. Register a BroadcastReceiver to be run in the main activity thread. Register to receive intent broadcasts, with the receiver optionally being exposed to Instant Apps. Register to receive intent broadcasts, to run in the context of scheduler . Register to receive intent broadcasts, to run in the context of scheduler . This method is deprecated. Sticky broadcasts should not be used. They provide no security (anyone can access them), no protection (anyone can modify them), and many other problems. The recommended pattern is to use a non-sticky broadcast to report that something has changed, with another mechanism for apps to retrieve the current value whenever desired. This method is deprecated. Sticky broadcasts should not be used. They provide no security (anyone can access them), no protection (anyone can modify them), and many other problems. The recommended pattern is to use a non-sticky broadcast to report that something has changed, with another mechanism for apps to retrieve the current value whenever desired. Triggers the revocation of one or more permissions for the calling package. Remove all permissions to access a particular content provider Uri that were previously added with grantUriPermission(String, Uri, int) or any other mechanism. Remove permissions to access a particular content provider Uri that were previously added with grantUriPermission(String, Uri, int) for a specific target package. Broadcast the given intent to all interested BroadcastReceivers, allowing an optional required permission to be enforced. Broadcast the given intent to all interested BroadcastReceivers, allowing an optional required permission to be enforced. Broadcast the given intent to all interested BroadcastReceivers. Version of sendBroadcast(Intent) that allows you to specify the user the broadcast will be sent to. Version of sendBroadcast(Intent,String) that allows you to specify the user the broadcast will be sent to. Version of sendOrderedBroadcast(Intent,String,BroadcastReceiver,Handler,int,String,Bundle) that allows you to specify the App Op to enforce restrictions on which receivers the broadcast will be sent to. Version of sendBroadcast(Intent) that allows you to receive data back from the broadcast. Broadcast the given intent to all interested BroadcastReceivers, delivering them one at a time to allow more preferred receivers to consume the broadcast before it is delivered to less preferred receivers. Version of sendBroadcast(Intent) that allows you to receive data back from the broadcast. Broadcast the given intent to all interested BroadcastReceivers, delivering them one at a time to allow more preferred receivers to consume the broadcast before it is delivered to less preferred receivers. Version of sendOrderedBroadcast(Intent,String,BroadcastReceiver,Handler,int,String,Bundle) that allows you to specify the user the broadcast will be sent to. This method is deprecated. Sticky broadcasts should not be used. They provide no security (anyone can access them), no protection (anyone can modify them), and many other problems. The recommended pattern is to use a non-sticky broadcast to report that something has changed, with another mechanism for apps to retrieve the current value whenever desired. This method is deprecated. Sticky broadcasts should not be used. They provide no security (anyone can access them), no protection (anyone can modify them), and many other problems. The recommended pattern is to use a non-sticky broadcast to report that something has changed, with another mechanism for apps to retrieve the current value whenever desired. This method is deprecated. Sticky broadcasts should not be used. They provide no security (anyone can access them), no protection (anyone can modify them), and many other problems. The recommended pattern is to use a non-sticky broadcast to report that something has changed, with another mechanism for apps to retrieve the current value whenever desired. This method is deprecated. Sticky broadcasts should not be used. They provide no security (anyone can access them), no protection (anyone can modify them), and many other problems. The recommended pattern is to use a non-sticky broadcast to report that something has changed, with another mechanism for apps to retrieve the current value whenever desired. This method is deprecated. Sticky broadcasts should not be used. They provide no security (anyone can access them), no protection (anyone can modify them), and many other problems. The recommended pattern is to use a non-sticky broadcast to report that something has changed, with another mechanism for apps to retrieve the current value whenever desired. Set the base theme for this context. This method is deprecated. Use WallpaperManager.set() instead. This method requires the caller to hold the permission Manifest.permission.SET_WALLPAPER . This method requires the caller to hold the permission Manifest.permission.SET_WALLPAPER . This method is deprecated. Use WallpaperManager.set() instead. This method requires the caller to hold the permission Manifest.permission.SET_WALLPAPER . This method requires the caller to hold the permission Manifest.permission.SET_WALLPAPER . Gets whether you should show UI with rationale before requesting a permission. Launch multiple new activities. Same as startActivities(Intent[],Bundle) with no options specified. Same as startActivity(Intent,Bundle) with no options specified. Launch a new activity. Similar to startService(Intent) , but with an implicit promise that the Service will call startForeground(int, android.app.Notification) once it begins running. Start executing an Instrumentation class. Same as startIntentSender(IntentSender,Intent,int,int,int,Bundle) with no options specified. Like startActivity(Intent,Bundle) , but taking a IntentSender to start. Request that a given application service be started. Request that a given application service be stopped. Disconnect from an application service. Remove a ComponentCallbacks object that was previously registered with registerComponentCallbacks(ComponentCallbacks) . Removes a device ID changed listener from the Context. Unregister a previously registered BroadcastReceiver. Perform a batch update of existing bindings. For a service previously bound with bindService(Intent, BindServiceFlags, Executor, ServiceConnection) or a related method, change how the system manages that service's process in relation to other processes. Variation of bindService(Intent, BindServiceFlags, Executor, ServiceConnection) that, in the specific case of isolated services, allows the caller to generate multiple instances of a service from a single component declaration. See bindIsolatedService(Intent,int,String,Executor,ServiceConnection) Call BindServiceFlags.of(long) to obtain a BindServiceFlags object. Same as bindService(Intent, ServiceConnection, int) with executor to control ServiceConnection callbacks. See bindService(Intent,ServiceConnection,int) Call BindServiceFlags.of(long) to obtain a BindServiceFlags object. Connects to an application service, creating it if needed. See bindService(Intent,int,Executor,ServiceConnection) Call BindServiceFlags.of(long) to obtain a BindServiceFlags object. Binds to a service in the given user in the same manner as bindService(Intent, BindServiceFlags, Executor, ServiceConnection) . See bindServiceAsUser(Intent,ServiceConnection,int,UserHandle) Call BindServiceFlags.of(long) to obtain a BindServiceFlags object. Determine whether the calling process of an IPC or you have been granted a particular permission. Determine whether the calling process of an IPC or you has been granted permission to access a specific URI. Determine whether the calling process of an IPC or you has been granted permission to access a list of URIs. Determine whether the calling process of an IPC you are handling has been granted a particular permission. Determine whether the calling process and uid has been granted permission to access a specific URI. Determine whether the calling process and uid has been granted permission to access a list of URIs. Determine whether a particular process and uid has been granted permission to access a specific content URI. Determine whether the given permission is allowed for a particular process and user ID running in the system. Determine whether you have been granted a particular permission. Check both a Uri and normal permission. Determine whether a particular process and uid has been granted permission to access a specific URI. Determine whether a particular process and uid has been granted permission to access a list of URIs. This method was deprecated in API level 15. Use WallpaperManager.clear() instead. This method requires the caller to hold the permission Manifest.permission.SET_WALLPAPER . This method requires the caller to hold the permission Manifest.permission.SET_WALLPAPER . Return a new Context object for the current Context but attribute to a different tag. Return a new Context object for the current Context but whose resources are adjusted to match the given Configuration. Creates a context with specific properties and behaviors. Return a new Context object for the given split name. Returns a new Context object from the current context but with device association given by the deviceId . Return a new Context object for the current Context but whose storage APIs are backed by device-protected storage. Returns a new Context object from the current context but with resources adjusted to match the metrics of display . Return a new Context object for the given application name. Creates a Context for a non-activity window. Creates a Context for a non- activity window on the given Display . Returns an array of strings naming the private databases associated with this Context's application package. Delete an existing private SQLiteDatabase associated with this Context's application package. Delete the given private file associated with this Context's application package. Delete an existing shared preferences file. If neither you nor the calling process of an IPC you are handling has been granted a particular permission, throw a SecurityException . If the calling process of an IPC or you has not been granted permission to access a specific URI, throw SecurityException . If the calling process of an IPC you are handling has not been granted a particular permission, throw a SecurityException . If the calling process and uid has not been granted permission to access a specific URI, throw SecurityException . If the given permission is not allowed for a particular process and user ID running in the system, throw a SecurityException . Enforce both a Uri and normal permission. If a particular process and uid has not been granted permission to access a specific URI, throw SecurityException . Returns an array of strings naming the private files associated with this Context's application package. Return the context of the single, global Application object of the current process. Return the full application info for this context's package. Returns an AssetManager instance for the application's package. Attribution can be used in complex apps to logically separate parts of the app. Attribution can be used in complex apps to logically separate parts of the app. Returns the absolute path to the application specific cache directory on the filesystem. Return a class loader you can use to retrieve classes in this package. Returns the absolute path to the application specific cache directory on the filesystem designed for storing cached code. Returns a color associated with a particular resource ID and styled for the current theme. Returns a color state list associated with a particular resource ID and styled for the current theme. Return a ContentResolver instance for your application's package. Returns the absolute path to the directory on the filesystem where all private files belonging to this app are stored. Returns the absolute path on the filesystem where a database created with openOrCreateDatabase(String, int, CursorFactory) is stored. Gets the device ID this context is associated with. Retrieve, creating if needed, a new directory in which the application can place its own custom data files. Get the display this context is associated with. Returns a drawable object associated with a particular resource ID and styled for the current theme. Returns absolute path to application-specific directory on the primary shared/external storage device where the application can place cache files it owns. Returns absolute paths to application-specific directories on all shared/external storage devices where the application can place cache files it owns. Returns the absolute path to the directory on the primary shared/external storage device where the application can place persistent files it owns. Returns absolute paths to application-specific directories on all shared/external storage devices where the application can place persistent files it owns. This method was deprecated in API level 30. These directories still exist and are scanned, but developers are encouraged to migrate to inserting content into a MediaStore collection directly, as any app can contribute new media to MediaStore with no permissions required, starting in Build.VERSION_CODES.Q . Returns the absolute path on the filesystem where a file created with openFileOutput(String, int) is stored. Returns the absolute path to the directory on the filesystem where files created with openFileOutput(String, int) are stored. Return an Executor that will run enqueued tasks on the main thread associated with this context. Return the Looper for the main thread of the current process. Returns the absolute path to the directory on the filesystem similar to getFilesDir() . Return the primary shared/external storage directory where this application's OBB files (if there are any) can be found. Returns absolute paths to application-specific directories on all shared/external storage devices where the application's OBB files (if there are any) can be found. Return the package name that should be used for AppOpsManager calls from this context, so that app ops manager's uid verification will work with the name. Return the full path to this context's primary Android package. Return PackageManager instance to find global package information. Return the name of this application's package. Return the full path to this context's primary Android package. Return the set of parameters which this Context was created with, if it was created via createContext(ContextParams) . Returns a Resources instance for the application's package. Retrieve and hold the contents of the preferences file 'name', returning a SharedPreferences through which you can retrieve and modify its values. Returns a localized string from the application's package's default string table. Returns a localized formatted string from the application's package's default string table, substituting the format arguments as defined in Formatter and String.format(String, Object) . Return the handle to a system-level service by class. Return the handle to a system-level service by name. Gets the name of the system-level service that is represented by the specified class. Return a localized, styled CharSequence from the application's package's default string table. Return the Theme object associated with this Context. Gets the list of bind flags that may be updated (i.e. This method was deprecated in API level 15. Use WallpaperManager.get() instead. This method was deprecated in API level 15. Use WallpaperManager.getDesiredMinimumHeight() instead. This method was deprecated in API level 15. Use WallpaperManager.getDesiredMinimumWidth() instead. Grant permission to access a specific Uri to another package, regardless of whether that package has general permission to access the Uri's content provider. Indicates if the storage APIs of this Context are backed by device-protected storage. Indicates whether this Context is restricted. Returns true if the context is a UI context which can access UI components such as WindowManager , LayoutInflater or WallpaperManager . Move an existing database file from the given source storage context to this context. Move an existing shared preferences file from the given source storage context to this context. Retrieve styled attribute information in this Context's theme. Retrieve styled attribute information in this Context's theme. Retrieve styled attribute information in this Context's theme. Retrieve styled attribute information in this Context's theme. Open a private file associated with this Context's application package for reading. Open a private file associated with this Context's application package for writing. Open a new private SQLiteDatabase associated with this Context's application package. Open a new private SQLiteDatabase associated with this Context's application package. This method was deprecated in API level 15. Use WallpaperManager.peek() instead. Rebind an application service with updated bind service flags Add a new ComponentCallbacks to the base application of the Context, which will be called at the same times as the ComponentCallbacks methods of activities and other components are called. Adds a new device ID changed listener to the Context , which will be called when the device association is changed by the system. Register a BroadcastReceiver to be run in the main activity thread. Register to receive intent broadcasts, with the receiver optionally being exposed to Instant Apps. Register to receive intent broadcasts, to run in the context of scheduler . Register to receive intent broadcasts, to run in the context of scheduler . This method was deprecated in API level 21. Sticky broadcasts should not be used. They provide no security (anyone can access them), no protection (anyone can modify them), and many other problems. The recommended pattern is to use a non-sticky broadcast to report that something has changed, with another mechanism for apps to retrieve the current value whenever desired. This method was deprecated in API level 21. Sticky broadcasts should not be used. They provide no security (anyone can access them), no protection (anyone can modify them), and many other problems. The recommended pattern is to use a non-sticky broadcast to report that something has changed, with another mechanism for apps to retrieve the current value whenever desired. Triggers the asynchronous revocation of a runtime permission. Triggers the revocation of one or more permissions for the calling package. Remove all permissions to access a particular content provider Uri that were previously added with grantUriPermission(String, Uri, int) or any other mechanism. Remove permissions to access a particular content provider Uri that were previously added with grantUriPermission(String, Uri, int) for a specific target package. Broadcast the given intent to all interested BroadcastReceivers, allowing an optional required permission to be enforced. Broadcast the given intent to all interested BroadcastReceivers, allowing an optional required permission to be enforced. Broadcast the given intent to all interested BroadcastReceivers. Version of sendBroadcast(Intent) that allows you to specify the user the broadcast will be sent to. Version of sendBroadcast(Intent,String) that allows you to specify the user the broadcast will be sent to. Broadcast the given intent to all interested BroadcastReceivers, allowing an array of required permissions to be enforced. Version of sendOrderedBroadcast(Intent,String,BroadcastReceiver,Handler,int,String,Bundle) that allows you to specify the App Op to enforce restrictions on which receivers the broadcast will be sent to. Version of sendBroadcast(Intent) that allows you to receive data back from the broadcast. Broadcast the given intent to all interested BroadcastReceivers, delivering them one at a time to allow more preferred receivers to consume the broadcast before it is delivered to less preferred receivers. Version of sendBroadcast(Intent) that allows you to receive data back from the broadcast. Broadcast the given intent to all interested BroadcastReceivers, delivering them one at a time to allow more preferred receivers to consume the broadcast before it is delivered to less preferred receivers. Version of sendOrderedBroadcast(Intent,String,BroadcastReceiver,Handler,int,String,Bundle) that allows you to specify the user the broadcast will be sent to. This method was deprecated in API level 21. Sticky broadcasts should not be used. They provide no security (anyone can access them), no protection (anyone can modify them), and many other problems. The recommended pattern is to use a non-sticky broadcast to report that something has changed, with another mechanism for apps to retrieve the current value whenever desired. This method was deprecated in API level 31. Sticky broadcasts should not be used. They provide no security (anyone can access them), no protection (anyone can modify them), and many other problems. The recommended pattern is to use a non-sticky broadcast to report that something has changed, with another mechanism for apps to retrieve the current value whenever desired. This method was deprecated in API level 21. Sticky broadcasts should not be used. They provide no security (anyone can access them), no protection (anyone can modify them), and many other problems. The recommended pattern is to use a non-sticky broadcast to report that something has changed, with another mechanism for apps to retrieve the current value whenever desired. This method was deprecated in API level 21. Sticky broadcasts should not be used. They provide no security (anyone can access them), no protection (anyone can modify them), and many other problems. The recommended pattern is to use a non-sticky broadcast to report that something has changed, with another mechanism for apps to retrieve the current value whenever desired. This method was deprecated in API level 21. Sticky broadcasts should not be used. They provide no security (anyone can access them), no protection (anyone can modify them), and many other problems. The recommended pattern is to use a non-sticky broadcast to report that something has changed, with another mechanism for apps to retrieve the current value whenever desired. Set the base theme for this context. This method was deprecated in API level 15. Use WallpaperManager.set() instead. This method requires the caller to hold the permission Manifest.permission.SET_WALLPAPER . This method requires the caller to hold the permission Manifest.permission.SET_WALLPAPER . This method was deprecated in API level 15. Use WallpaperManager.set() instead. This method requires the caller to hold the permission Manifest.permission.SET_WALLPAPER . This method requires the caller to hold the permission Manifest.permission.SET_WALLPAPER . Gets whether you should show UI with rationale before requesting a permission. Launch multiple new activities. Same as startActivities(Intent[],Bundle) with no options specified. Same as startActivity(Intent,Bundle) with no options specified. Launch a new activity. Similar to startService(Intent) , but with an implicit promise that the Service will call startForeground(int, android.app.Notification) once it begins running. Start executing an Instrumentation class. Same as startIntentSender(IntentSender,Intent,int,int,int,Bundle) with no options specified. Like startActivity(Intent,Bundle) , but taking a IntentSender to start. Request that a given application service be started. Request that a given application service be stopped. Disconnect from an application service. Remove a ComponentCallbacks object that was previously registered with registerComponentCallbacks(ComponentCallbacks) . Removes a device ID changed listener from the Context. Unregister a previously registered BroadcastReceiver. Perform a batch update of existing bindings. For a service previously bound with bindService(Intent, BindServiceFlags, Executor, ServiceConnection) or a related method, change how the system manages that service's process in relation to other processes. Creates and returns a copy of this object. Indicates whether some other object is "equal to" this one. Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. Returns the runtime class of this Object . Returns a hash code value for the object. Wakes up a single thread that is waiting on this object's monitor. Wakes up all threads that are waiting on this object's monitor. Returns a string representation of the object. Causes the current thread to wait until it is awakened, typically by being notified or interrupted , or until a certain amount of real time has elapsed. Causes the current thread to wait until it is awakened, typically by being notified or interrupted , or until a certain amount of real time has elapsed. Causes the current thread to wait until it is awakened, typically by being notified or interrupted . Called when the operating system has determined that it is a good time for a process to trim unneeded memory from its process. Called by the system when the device configuration changes while your component is running. This method was deprecated in API level 35. Since API level 14 this is superseded by ComponentCallbacks2.onTrimMemory . Since API level 34 this is never called. If you're overriding ComponentCallbacks2#onTrimMemory and your minSdkVersion is greater than API 14, you can provide an empty implementation for this method. Public constructors Returns the name of the current process. A package's default process name is the same as its package name. Non-default processes will look like "$PACKAGE_NAME:$NAME", where $NAME corresponds to an android:process attribute within AndroidManifest.xml. onConfigurationChanged Called by the system when the device configuration changes while your component is running. Note that, unlike activities, other components are never restarted when a configuration changes: they must always deal with the results of the change, such as by re-retrieving resources. At the time that this function has been called, your Resources object will have been updated to return resource values matching the new configuration. For more information, read Handling Runtime Changes . If you override this method you must call through to the superclass implementation. Parameters newConfig Configuration : This value cannot be null . At the time that this function has been called, your Resources object will have been updated to return resource values matching the new configuration. For more information, read Handling Runtime Changes . If you override this method you must call through to the superclass implementation. For more information, read Handling Runtime Changes . If you override this method you must call through to the superclass implementation. Called when the application is starting, before any activity, service, or receiver objects (excluding content providers) have been created. Implementations should be as quick as possible (for example using lazy initialization of state) since the time spent in this function directly impacts the performance of starting the first activity, service, or receiver in a process. If you override this method, be sure to call super.onCreate() . Be aware that direct boot may also affect callback order on Android Build.VERSION_CODES.N and later devices. Until the user unlocks the device, only direct boot aware components are allowed to run. You should consider that all direct boot unaware components, including such ContentProvider , are disabled until user unlock happens, especially when component callback order matters. . If you override this method you must call through to the superclass implementation. Implementations should be as quick as possible (for example using lazy initialization of state) since the time spent in this function directly impacts the performance of starting the first activity, service, or receiver in a process. If you override this method, be sure to call super.onCreate() . Be aware that direct boot may also affect callback order on Android Build.VERSION_CODES.N and later devices. Until the user unlocks the device, only direct boot aware components are allowed to run. You should consider that all direct boot unaware components, including such ContentProvider , are disabled until user unlock happens, especially when component callback order matters. This is called when the overall system is running low on memory, and actively running processes should trim their memory usage. While the exact point at which this will be called is not defined, generally it will happen when all background process have been killed. That is, before reaching the point of killing processes hosting service and foreground UI that we would like to avoid killing. If you override this method you must call through to the superclass implementation. This method is for use in emulated process environments. It will never be called on a production Android device, where processes are removed by simply killing them; no user code (including this callback) is executed when doing so. If you override this method you must call through to the superclass implementation. Called when the operating system has determined that it is a good time for a process to trim unneeded memory from its process. You should never compare to exact values of the level, since new intermediate values may be added -- you will typically want to compare if the value is greater or equal to a level you are interested in. To retrieve the processes current trim level at any point, you can use ActivityManager.getMyMemoryState(RunningAppProcessInfo) . If you override this method you must call through to the superclass implementation. To retrieve the processes current trim level at any point, you can use ActivityManager.getMyMemoryState(RunningAppProcessInfo) . If you override this method you must call through to the superclass implementation. ComponentCallbacks2.TRIM_MEMORY_COMPLETE ComponentCallbacks2.TRIM_MEMORY_MODERATE ComponentCallbacks2.TRIM_MEMORY_BACKGROUND ComponentCallbacks2.TRIM_MEMORY_UI_HIDDEN ComponentCallbacks2.TRIM_MEMORY_RUNNING_CRITICAL ComponentCallbacks2.TRIM_MEMORY_RUNNING_LOW ComponentCallbacks2.TRIM_MEMORY_RUNNING_MODERATE registerActivityLifecycleCallbacks registerComponentCallbacks Add a new ComponentCallbacks to the base application of the Context, which will be called at the same times as the ComponentCallbacks methods of activities and other components are called. Note that you must be sure to use unregisterComponentCallbacks(ComponentCallbacks) when appropriate in the future; this will not be removed for you. After Build.VERSION_CODES.TIRAMISU , the ComponentCallbacks will be registered to the base Context , and can be only used after attachBaseContext(Context) . Users can still call to getApplicationContext().registerComponentCallbacks(ComponentCallbacks) to add ComponentCallbacks to the base application. After Build.VERSION_CODES.TIRAMISU , the ComponentCallbacks will be registered to the base Context , and can be only used after attachBaseContext(Context) . Users can still call to getApplicationContext().registerComponentCallbacks(ComponentCallbacks) to add ComponentCallbacks to the base application. registerOnProvideAssistDataListener unregisterActivityLifecycleCallbacks unregisterComponentCallbacks Remove a ComponentCallbacks object that was previously registered with registerComponentCallbacks(ComponentCallbacks) . After Build.VERSION_CODES.TIRAMISU , the ComponentCallbacks will be unregistered to the base Context , and can be only used after attachBaseContext(Context) After Build.VERSION_CODES.TIRAMISU , the ComponentCallbacks will be unregistered to the base Context , and can be only used after attachBaseContext(Context) unregisterOnProvideAssistDataListener Content and code samples on this page are subject to the licenses described in the Content License . Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates. Last updated 2026-09-16 UTC.
📥 下载地址(文章结尾)
装机神器,可安装一切系统,纯净版,英文版,繁体版 ,精简版,原版等等等