I
- The actual class, so method chain can return the generated class
and provide generated methodspublic abstract class ActivityIntentBuilder<I extends ActivityIntentBuilder<I>> extends IntentBuilder<I> implements ActivityStarter
Activity
Intent
builders, which provide a fluent API to build Intent
s and start the
generated Activity
.Modifier and Type | Field and Description |
---|---|
protected android.os.Bundle |
lastOptions |
context, intent
Constructor and Description |
---|
ActivityIntentBuilder(android.content.Context context,
Class<?> clazz)
Creates a builder for a given
Activity
class. |
ActivityIntentBuilder(android.content.Context context,
android.content.Intent intent)
Creates a builder which will append to a previously created
Intent . |
Modifier and Type | Method and Description |
---|---|
void |
start()
Starts the
Activity , by calling
Activity#startActivity(android.content.Intent) for the previously given
Context or Fragment or support Fragment
objects. |
abstract void |
startForResult(int requestCode)
Starts the
Activity for result, by calling
Activity#startActivityForResult(android.content.Intent, int) for the
previously given Context or Fragment or
support Fragment objects. |
ActivityStarter |
withOptions(android.os.Bundle options)
Adds additional options
Bundle to the start method. |
action, extra, extra, extra, extra, extra, extra, extra, extra, extra, extra, extra, extra, extra, extra, extra, extra, extra, extra, extra, extra, extra, extra, extra, extras, flags, get, getContext, integerArrayListExtra, parcelableArrayListExtra, stringArrayListExtra
public ActivityIntentBuilder(android.content.Context context, Class<?> clazz)
Activity
class.context
- A Context
of the application package implementing this
class.clazz
- The component class that is to be used for the Intent
.public ActivityIntentBuilder(android.content.Context context, android.content.Intent intent)
Intent
.context
- A Context
of the application package implementing this
class.intent
- The previously created Intent
to append to.public final void start()
ActivityStarter
Activity
, by calling
Activity#startActivity(android.content.Intent)
for the previously given
Context
or Fragment or support Fragment
objects. It also passes the given extras, the options
Bundle
, if new methods are available which
accept that.start
in interface ActivityStarter
public abstract void startForResult(int requestCode)
ActivityStarter
Activity
for result, by calling
Activity#startActivityForResult(android.content.Intent, int)
for the
previously given Context
or Fragment or
support Fragment objects. It also passes the given extras, the options
Bundle
, if new methods are available which
accept that.startForResult
in interface ActivityStarter
requestCode
- this code will be returned in onActivityResult() when the
activity exits.public ActivityStarter withOptions(android.os.Bundle options)
Bundle
to the start method.options
- the Activity
optionsActivityStarter
instance to provide starter methodsCopyright © 2010-2015. All Rights Reserved.