{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}
public abstract class SingleActivityFactory<T extends Activity> implements InterceptingActivityFactory
Abstract implementation of InterceptingActivityFactory which allows to intercept only one activity at a time. Child classes are responsible for creating activity object.
Public fields |
|
|---|---|
final Class<T> |
|
Public constructors |
|
|---|---|
SingleActivityFactory(Class<T> activityClassToIntercept) |
|
Public methods |
|
|---|---|
final Activity |
create(ClassLoader classLoader, String className, Intent intent) |
final Class<T> |
This method can be used to get the Class of activity being instantiated by this factory. |
final boolean |
shouldIntercept( |
Protected methods |
|
|---|---|
abstract T |
This method needs to be implemented by child class to create activity object for the given intent that specified the activity class being instantiated. |
public final Class<T> getActivityClassToIntercept()
This method can be used to get the Class of activity being instantiated by this factory.
| Returns | |
|---|---|
Class<T> |
Class of the activity object being instantiated |
public final boolean shouldIntercept(
ClassLoader classLoader,
String className,
Intent intent
)
protected abstract T create(Intent intent)
This method needs to be implemented by child class to create activity object for the given intent that specified the activity class being instantiated.
| Parameters | |
|---|---|
Intent intent |
The Intent object that specified the activity class being instantiated. |
| Returns | |
|---|---|
T |
The newly instantiated Activity object. |