public class

MockApplication

extends Application
java.lang.Object
   ↳ android.content.Context
     ↳ android.content.ContextWrapper
       ↳ android.app.Application
         ↳ android.test.mock.MockApplication

Class Overview

A mock Application class. All methods are non-functional and throw UnsupportedOperationException. Override it as necessary to provide the operations that you need.

Summary

[Expand]
Inherited Constants
From class android.content.Context
Public Constructors
MockApplication()
Public Methods
void onConfigurationChanged(Configuration newConfig)
Called by the system when the device configuration changes while your component is running.
void onCreate()
Called when the application is starting, before any other application objects have been created.
void onTerminate()
Called when the application is stopping.
[Expand]
Inherited Methods
From class android.app.Application
From class android.content.ContextWrapper
From class android.content.Context
From class java.lang.Object
From interface android.content.ComponentCallbacks

Public Constructors

public MockApplication ()

Public Methods

public void onConfigurationChanged (Configuration newConfig)

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.

Parameters
newConfig The new device configuration.

public void onCreate ()

Called when the application is starting, before any other application objects 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().

public void onTerminate ()

Called when the application is stopping. There are no more application objects running and the process will exit. Note: never depend on this method being called; in many cases an unneeded application process will simply be killed by the kernel without executing any application code. If you override this method, be sure to call super.onTerminate().