Flutter Engine
The Flutter Engine
Static Public Member Functions | List of all members
io.flutter.embedding.android.RobolectricFlutterActivity Class Reference

Static Public Member Functions

static FlutterActivity createFlutterActivity (@NonNull Intent intent)
 
static FlutterActivityLaunchConfigs.BackgroundMode getBackgroundMode ( @NonNull FlutterActivity activity)
 

Detailed Description

Creates a FlutterActivity for use by test code that do not sit within the
io.flutter.embedding.android
package, and offers public access to some package private properties of FlutterActivity for testing purposes.

Definition at line 13 of file RobolectricFlutterActivity.java.

Member Function Documentation

◆ createFlutterActivity()

static FlutterActivity io.flutter.embedding.android.RobolectricFlutterActivity.createFlutterActivity ( @NonNull Intent  intent)
inlinestatic

Creates a FlutterActivity that is controlled by Robolectric, which otherwise can not be done in a test outside of the io.flutter.embedding.android package.

Definition at line 19 of file RobolectricFlutterActivity.java.

19 {
20 ActivityController<FlutterActivity> activityController =
21 Robolectric.buildActivity(FlutterActivity.class, intent);
22 FlutterActivity flutterActivity = activityController.get();
23 flutterActivity.setDelegate(new FlutterActivityAndFragmentDelegate(flutterActivity));
24 return flutterActivity;
25 }

◆ getBackgroundMode()

static FlutterActivityLaunchConfigs.BackgroundMode io.flutter.embedding.android.RobolectricFlutterActivity.getBackgroundMode ( @NonNull FlutterActivity  activity)
inlinestatic

Returns a given FlutterActivity's BackgroundMode for use by tests that do not sit in the io.flutter.embedding.android package.

Definition at line 32 of file RobolectricFlutterActivity.java.

33 {
34 return activity.getBackgroundMode();
35 }

The documentation for this class was generated from the following file: