Class SupportFragmentController<F extends android.support.v4.app.Fragment>
- java.lang.Object
-
- org.robolectric.android.controller.ComponentController<SupportFragmentController<F>,F>
-
- org.robolectric.shadows.support.v4.SupportFragmentController<F>
-
- Type Parameters:
F
- a class of the fragment which is under control by this class.
@Deprecated public class SupportFragmentController<F extends android.support.v4.app.Fragment> extends ComponentController<SupportFragmentController<F>,F>
Deprecated.FragmentController provides low-level APIs to control fragment's lifecycle.Using FragmentController directly from your tests is strongly discouraged. You have to call all the lifecycle callback methods (create, start, ...) in the same manner as the Android framework by yourself otherwise you'll see fidelity issues. Consider using
androidx.fragment.app.testing.FragmentScenario
instead, which provides higher-level, streamlined APIs to control the lifecycle and it works with instrumentation tests too.
-
-
Field Summary
-
Fields inherited from class org.robolectric.android.controller.ComponentController
attached, component, intent, myself, shadowMainLooper
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SupportFragmentController(F fragment, Class<? extends android.support.v4.app.FragmentActivity> activityClass)
Deprecated.protected
SupportFragmentController(F fragment, Class<? extends android.support.v4.app.FragmentActivity> activityClass, Intent intent)
Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description SupportFragmentController<F>
create()
Deprecated.SupportFragmentController<F>
create(int contentViewId, Bundle bundle)
Deprecated.Creates the activity withBundle
and adds the fragment to the view with IDcontentViewId
.SupportFragmentController<F>
create(Bundle bundle)
Deprecated.Creates the activity withBundle
and adds the fragment to it.SupportFragmentController<F>
destroy()
Deprecated.static <F extends android.support.v4.app.Fragment>
SupportFragmentController<F>of(F fragment)
Deprecated.static <F extends android.support.v4.app.Fragment>
SupportFragmentController<F>of(F fragment, Class<? extends android.support.v4.app.FragmentActivity> activityClass)
Deprecated.static <F extends android.support.v4.app.Fragment>
SupportFragmentController<F>of(F fragment, Class<? extends android.support.v4.app.FragmentActivity> activityClass, Intent intent)
Deprecated.SupportFragmentController<F>
pause()
Deprecated.SupportFragmentController<F>
postCreate(Bundle bundle)
Deprecated.SupportFragmentController<F>
resume()
Deprecated.SupportFragmentController<F>
saveInstanceState(Bundle outState)
Deprecated.static <F extends android.support.v4.app.Fragment>
FsetupFragment(F fragment)
Deprecated.Sets up the given fragment by attaching it to an activity, calling its onCreate() through onResume() lifecycle methods, and then making it visible.static <F extends android.support.v4.app.Fragment>
FsetupFragment(F fragment, Class<? extends android.support.v4.app.FragmentActivity> fragmentActivityClass)
Deprecated.Sets up the given fragment by attaching it to an activity, calling its onCreate() through onResume() lifecycle methods, and then making it visible.static <F extends android.support.v4.app.Fragment>
FsetupFragment(F fragment, Class<? extends android.support.v4.app.FragmentActivity> fragmentActivityClass, int containerViewId, Bundle bundle)
Deprecated.Sets up the given fragment by attaching it to an activity created with the given bundle and container id, calling its onCreate() through onResume() lifecycle methods, and then making it visible.static <F extends android.support.v4.app.Fragment>
FsetupFragment(F fragment, Class<? extends android.support.v4.app.FragmentActivity> fragmentActivityClass, Bundle bundle)
Deprecated.Sets up the given fragment by attaching it to an activity created with the given bundle, calling its onCreate() through onResume() lifecycle methods, and then making it visible.SupportFragmentController<F>
start()
Deprecated.SupportFragmentController<F>
stop()
Deprecated.SupportFragmentController<F>
visible()
Deprecated.-
Methods inherited from class org.robolectric.android.controller.ComponentController
get, getIntent, invokeWhilePaused, invokeWhilePaused
-
-
-
-
Method Detail
-
of
public static <F extends android.support.v4.app.Fragment> SupportFragmentController<F> of(F fragment)
Deprecated.
-
of
public static <F extends android.support.v4.app.Fragment> SupportFragmentController<F> of(F fragment, Class<? extends android.support.v4.app.FragmentActivity> activityClass)
Deprecated.
-
of
public static <F extends android.support.v4.app.Fragment> SupportFragmentController<F> of(F fragment, Class<? extends android.support.v4.app.FragmentActivity> activityClass, Intent intent)
Deprecated.
-
setupFragment
public static <F extends android.support.v4.app.Fragment> F setupFragment(F fragment)
Deprecated.Sets up the given fragment by attaching it to an activity, calling its onCreate() through onResume() lifecycle methods, and then making it visible. Note that the fragment will be added to the view with ID 1.
-
setupFragment
public static <F extends android.support.v4.app.Fragment> F setupFragment(F fragment, Class<? extends android.support.v4.app.FragmentActivity> fragmentActivityClass)
Deprecated.Sets up the given fragment by attaching it to an activity, calling its onCreate() through onResume() lifecycle methods, and then making it visible. Note that the fragment will be added to the view with ID 1.
-
setupFragment
public static <F extends android.support.v4.app.Fragment> F setupFragment(F fragment, Class<? extends android.support.v4.app.FragmentActivity> fragmentActivityClass, Bundle bundle)
Deprecated.Sets up the given fragment by attaching it to an activity created with the given bundle, calling its onCreate() through onResume() lifecycle methods, and then making it visible. Note that the fragment will be added to the view with ID 1.
-
setupFragment
public static <F extends android.support.v4.app.Fragment> F setupFragment(F fragment, Class<? extends android.support.v4.app.FragmentActivity> fragmentActivityClass, int containerViewId, Bundle bundle)
Deprecated.Sets up the given fragment by attaching it to an activity created with the given bundle and container id, calling its onCreate() through onResume() lifecycle methods, and then making it visible.
-
create
public SupportFragmentController<F> create(int contentViewId, Bundle bundle)
Deprecated.Creates the activity withBundle
and adds the fragment to the view with IDcontentViewId
.
-
create
public SupportFragmentController<F> create(Bundle bundle)
Deprecated.Creates the activity withBundle
and adds the fragment to it. Note that the fragment will be added to the view with ID 1.
-
create
public SupportFragmentController<F> create()
Deprecated.- Specified by:
create
in classComponentController<SupportFragmentController<F extends android.support.v4.app.Fragment>,F extends android.support.v4.app.Fragment>
-
postCreate
public SupportFragmentController<F> postCreate(Bundle bundle)
Deprecated.
-
destroy
public SupportFragmentController<F> destroy()
Deprecated.- Specified by:
destroy
in classComponentController<SupportFragmentController<F extends android.support.v4.app.Fragment>,F extends android.support.v4.app.Fragment>
-
start
public SupportFragmentController<F> start()
Deprecated.
-
resume
public SupportFragmentController<F> resume()
Deprecated.
-
pause
public SupportFragmentController<F> pause()
Deprecated.
-
stop
public SupportFragmentController<F> stop()
Deprecated.
-
visible
public SupportFragmentController<F> visible()
Deprecated.
-
saveInstanceState
public SupportFragmentController<F> saveInstanceState(Bundle outState)
Deprecated.
-
-