Bundler

inline class Bundler(intent: Intent)

Bundler is a wrapper class of the Intent for putting intent data elegantly.

Constructors

Bundler
Link copied to clipboard
fun Bundler(intent: Intent = Intent())

Functions

addCategory
Link copied to clipboard
fun addCategory(category: String): Bundler
Add a new category to the intent.
addFlags
Link copied to clipboard
fun addFlags(flags: Int): Bundler
Add additional flags to the intent (or with existing flags value).
bundleOf
Link copied to clipboard
fun bundleOf(vararg pairs: Pair<String, Any?>): Bundler
Creates a new bundle and put it into the intent with the given key/value pairs as elements.
eq
Link copied to clipboard
infix fun String.eq(value: Any?): Intent
Inserts a key/value pair as an extra element.
fillIn
Link copied to clipboard
fun fillIn(other: Intent, flags: Int): Bundler
Copy the contents of other in to this object, but only where fields are not defined by this object.
filterEquals
Link copied to clipboard
fun filterEquals(other: Intent): Bundler
Determine if two intents are the same for the purposes of intent resolution (filtering).
putExtra
Link copied to clipboard
fun putExtra(pair: Pair<String, Any?>): Bundler
Inserts a new extra data with the given key/value pairs as elements.
fun putExtra(key: String, value: Any?): Bundler
Inserts a new extra data with the given key/value pair as an element.
removeCategory
Link copied to clipboard
fun removeCategory(category: String): Bundler
Remove a category from an intent.
replaceExtras
Link copied to clipboard
fun replaceExtras(src: Intent): Bundler
Completely replace the extras in the Intent with the extras in the given Intent.
fun replaceExtras(extras: Bundle?): Bundler
Completely replace the extras in the Intent with the given Bundle of extras.
setAction
Link copied to clipboard
fun setAction(action: String): Bundler
Set the general action to be performed.
setData
Link copied to clipboard
fun setData(data: Uri): Bundler
Set the data this intent is operating on.
setFlags
Link copied to clipboard
fun setFlags(flags: Int): Bundler
Set special flags controlling how this intent is handled.
startActivity
Link copied to clipboard
fun startActivity(context: Context)
Launch a new activity with no options specified.
fun startActivity(context: Context, options: Bundle)
Launch a new activity with options.
startActivityForResult
Link copied to clipboard
fun startActivityForResult(activity: Activity, requestCode: Int)
Launch an activity for which you would like a result when it finished.
fun startActivityForResult(activity: Activity, requestCode: Int, options: Bundle)
Launch an activity for which you would like a result when it finished.
startActivityIfNeeded
Link copied to clipboard
fun startActivityIfNeeded(activity: Activity, requestCode: Int): Boolean
A special variation to launch an activity only if a new activity instance is needed to handle the given Intent.
startNextMatchingActivity
Link copied to clipboard
fun startNextMatchingActivity(activity: Activity): Boolean
Special version of starting an activity, for use when you are replacing other activity components.
unaryMinus
Link copied to clipboard
operator fun String.unaryMinus()
Removes a previous extra.
unaryPlus
Link copied to clipboard
operator fun Pair<String, Any?>.unaryPlus(): Intent
Inserts a key/value pair as an extra element.

Properties

intent
Link copied to clipboard
val intent: Intent