Class ActivityController<T extends Activity>

java.lang.Object
org.robolectric.android.controller.ComponentController<ActivityController<T>,​T>
org.robolectric.android.controller.ActivityController<T>
Type Parameters:
T - a class of the activity which is under control by this class.
All Implemented Interfaces:
AutoCloseable

public class ActivityController<T extends Activity>
extends ComponentController<ActivityController<T>,​T>
implements AutoCloseable
ActivityController provides low-level APIs to control activity's lifecycle.

Using ActivityController directly from your tests is strongly discouraged. You have to call all the lifecycle callback methods (create, postCreate, start, ...) in the same manner as the Android framework by yourself otherwise you'll see fidelity issues. Consider using androidx.test.core.app.ActivityScenario instead, which provides higher-level, streamlined APIs to control the lifecycle and it works with instrumentation tests too.