The application class changes event handlers for application creation and finalization, low-availability memory, and configuration, and you can implement your own application behavior for several of these scenarios by overriding these methods:
1. OnCreate: This method is called when the application is created. You can override this method to instantiate application configurations, or you can create and instantiate any application state variables or shared resources.
2, Onlowmemory: This method is generally only in the background process has been terminated, but the foreground application is still missing memory when called. You can override this handler to empty the cache or release unnecessary resources.
3. Ontrimmemory: As an application-specific alternative to onlowmemory, it is introduced in Android 4.0 (API level13). Called when the runtime determines whether the current application should attempt to reduce its memory overhead (usually when it enters the background). It contains a level parameter that provides the context for the request.
4, onconfigurationchanged and activity, when the configuration changes, the Application object will not be terminated and restarted, if the application uses a value that depends on a specific configuration, then override this method to reload the value, or processing configuration changes at the application level.
Note: You must call the parent class's event handlers when overriding these methods.