public class SupportFragmentController<F extends android.support.v4.app.Fragment> extends org.robolectric.android.controller.ComponentController<SupportFragmentController<F>,F>
Version of FragmentController that can be used for android.support.v4.Fragment. Only necessary if more complex lifecycle management is needed, otherwise SupportFragmentTestUtil should be sufficient.
| Modifier | Constructor and Description |
|---|---|
protected |
SupportFragmentController(F fragment,
java.lang.Class<? extends android.support.v4.app.FragmentActivity> activityClass) |
protected |
SupportFragmentController(F fragment,
java.lang.Class<? extends android.support.v4.app.FragmentActivity> activityClass,
android.content.Intent intent) |
| Modifier and Type | Method and Description |
|---|---|
SupportFragmentController<F> |
attach()
Deprecated.
This is a no-op, it’s safe to remove this call.
This method will be removed in Robolectric 3.4. |
SupportFragmentController<F> |
create() |
SupportFragmentController<F> |
create(android.os.Bundle bundle)
Creates the activity with
Bundle and adds the fragment to it. |
SupportFragmentController<F> |
create(int contentViewId,
android.os.Bundle bundle)
Creates the activity with
Bundle and adds the fragment to the view with ID contentViewId. |
SupportFragmentController<F> |
destroy() |
static <F extends android.support.v4.app.Fragment> |
of(F fragment) |
static <F extends android.support.v4.app.Fragment> |
of(F fragment,
java.lang.Class<? extends android.support.v4.app.FragmentActivity> activityClass) |
static <F extends android.support.v4.app.Fragment> |
of(F fragment,
java.lang.Class<? extends android.support.v4.app.FragmentActivity> activityClass,
android.content.Intent intent) |
SupportFragmentController<F> |
pause() |
SupportFragmentController<F> |
resume() |
SupportFragmentController<F> |
start() |
SupportFragmentController<F> |
stop() |
SupportFragmentController<F> |
visible() |
SupportFragmentController<F> |
withIntent(android.content.Intent intent)
Deprecated.
Use
of(Fragment, Class, Intent) instead.
This method will be removed in Robolectric 3.4. |
protected SupportFragmentController(F fragment, java.lang.Class<? extends android.support.v4.app.FragmentActivity> activityClass)
protected SupportFragmentController(F fragment, java.lang.Class<? extends android.support.v4.app.FragmentActivity> activityClass, android.content.Intent intent)
public static <F extends android.support.v4.app.Fragment> SupportFragmentController<F> of(F fragment)
public static <F extends android.support.v4.app.Fragment> SupportFragmentController<F> of(F fragment, java.lang.Class<? extends android.support.v4.app.FragmentActivity> activityClass)
public static <F extends android.support.v4.app.Fragment> SupportFragmentController<F> of(F fragment, java.lang.Class<? extends android.support.v4.app.FragmentActivity> activityClass, android.content.Intent intent)
@Deprecated public SupportFragmentController<F> attach()
This method will be removed in Robolectric 3.4.
attach in class org.robolectric.android.controller.ComponentController<SupportFragmentController<F extends android.support.v4.app.Fragment>,F extends android.support.v4.app.Fragment>public SupportFragmentController<F> create(int contentViewId, android.os.Bundle bundle)
Creates the activity with Bundle and adds the fragment to the view with ID contentViewId.
public SupportFragmentController<F> create(android.os.Bundle bundle)
Creates the activity with Bundle and adds the fragment to it. Note that the fragment will be added to the view with ID 1.
public SupportFragmentController<F> create()
create in class org.robolectric.android.controller.ComponentController<SupportFragmentController<F extends android.support.v4.app.Fragment>,F extends android.support.v4.app.Fragment>public SupportFragmentController<F> destroy()
destroy in class org.robolectric.android.controller.ComponentController<SupportFragmentController<F extends android.support.v4.app.Fragment>,F extends android.support.v4.app.Fragment>public SupportFragmentController<F> start()
public SupportFragmentController<F> resume()
public SupportFragmentController<F> pause()
public SupportFragmentController<F> stop()
public SupportFragmentController<F> visible()
@Deprecated public SupportFragmentController<F> withIntent(android.content.Intent intent)
of(Fragment, Class, Intent) instead.
This method will be removed in Robolectric 3.4.
withIntent in class org.robolectric.android.controller.ComponentController<SupportFragmentController<F extends android.support.v4.app.Fragment>,F extends android.support.v4.app.Fragment>