Stay organized with collections
Save and categorize content based on your preferences.
class
Extra
:
AbstractSafeParcelable
Represents a single extra element. Not suitable for sending across the wire.
Summary
Represents a single extra element.
The byte array extra value.
The string key for the intent extra field.
The type of the extra value.
Public constructors
<init>
Extra
(
key
:
String
,
type
:
Int
,
stringExtra
:
String
?
=
null ,
booleanExtra
:
Boolean
?
=
null ,
intExtra
:
Int
?
=
null ,
byteArrayExtra
:
ByteArray
?
=
null ,
longExtra
:
Long
?
=
null )
Represents a single extra element. Not suitable for sending across the wire.
Public methods
writeToParcel
fun
writeToParcel
(
dest
:
Parcel
,
flags
:
Int
)
:
Unit
Properties
key
val
key
:
String
The string key for the intent extra field.
type
val
type
:
Int
The type of the extra value.
Companion properties
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License
, and code samples are licensed under the Apache 2.0 License
. For details, see the Google Developers Site Policies
. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-31 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-31 UTC."],[[["\u003cp\u003e\u003ccode\u003eExtra\u003c/code\u003e is a class representing a single extra element within the \u003ccode\u003ecom.google.android.gms.dtdi.core\u003c/code\u003e package and is not intended for network transmission.\u003c/p\u003e\n"],["\u003cp\u003eIt includes properties like \u003ccode\u003ekey\u003c/code\u003e, \u003ccode\u003etype\u003c/code\u003e, \u003ccode\u003estringExtra\u003c/code\u003e, \u003ccode\u003ebooleanExtra\u003c/code\u003e, \u003ccode\u003eintExtra\u003c/code\u003e, \u003ccode\u003ebyteArrayExtra\u003c/code\u003e, and \u003ccode\u003elongExtra\u003c/code\u003e to store various data types.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003etype\u003c/code\u003e property determines the data type of the extra value, corresponding to constants defined in \u003ccode\u003eExtraType\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eExtra\u003c/code\u003e provides a constructor to initialize these properties and the \u003ccode\u003ewriteToParcel\u003c/code\u003e method to write the object to a \u003ccode\u003eParcel\u003c/code\u003e.\u003c/p\u003e\n"]]],["The `Extra` class represents a single extra element, designed for internal use, not for transmission. It has a constructor that takes a key, type, and optional values for string, boolean, integer, byte array, and long types. Key actions are the creation of an `Extra` object with various data types and writing it to a parcel using the `writeToParcel` method. Properties like `key`, `type`, `stringExtra`, `booleanExtra`, `intExtra`, `byteArrayExtra`, and `longExtra` store the extra's data. The `CREATOR` is used to create the object.\n"],null,["# Extra\n=====\n\n```\nclass Extra : AbstractSafeParcelable\n```\n\n|---------------------------------------------|\n| [com.google.android.gms.dtdi.core.Extra](#) |\n\nRepresents a single extra element. Not suitable for sending across the wire.\n\nSummary\n-------\n\n| ### Public constructors ||\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [\u003cinit\u003e](#%3Cinit%3E(kotlin.String,%20kotlin.Int,%20kotlin.String,%20kotlin.Boolean,%20kotlin.Int,%20kotlin.ByteArray,%20kotlin.Long))`(`key:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, `type:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `stringExtra:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)?` `=` null, `booleanExtra:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)?` `=` null, `intExtra:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)?` `=` null, `byteArrayExtra:` `[ByteArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/index.html)?` `=` null, `longExtra:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)?` `=` null)` Represents a single extra element. |\n\n| ### Public methods ||\n|------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [writeToParcel](#writeToParcel(android.os.Parcel,%20kotlin.Int))`(`dest:` `[Parcel](https://developer.android.com/reference/android/os/Parcel.html)`, `flags:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` \u003cbr /\u003e |\n\n| ### Properties ||\n|------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------|\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)? | [booleanExtra](#booleanExtra:kotlin.Boolean) The boolean extra value. |\n| [ByteArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/index.html)? | [byteArrayExtra](#byteArrayExtra:kotlin.ByteArray) The byte array extra value. |\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)? | [intExtra](#intExtra:kotlin.Int) The int extra value. |\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [key](#key:kotlin.String) The string key for the intent extra field. |\n| [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)? | [longExtra](#longExtra:kotlin.Long) The long extra value. |\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)? | [stringExtra](#stringExtra:kotlin.String) The string extra value. |\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [type](#type:kotlin.Int) The type of the extra value. |\n\n| ### Companion properties ||\n|-----------------------------------------------------------------------------------------------------|--------------------------------------------------------------------|\n| [Creator](https://developer.android.com/reference/android/os/Parcelable/Creator.html)\\\u003c[Extra](#)\\\u003e | [CREATOR](#Companion.CREATOR:android.os.Parcelable.Creator) \u003cbr /\u003e |\n\nPublic constructors\n-------------------\n\n### \\\u003cinit\\\u003e\n\n```\nExtra(\n key: String, \n type: Int, \n stringExtra: String? = null, \n booleanExtra: Boolean? = null, \n intExtra: Int? = null, \n byteArrayExtra: ByteArray? = null, \n longExtra: Long? = null)\n```\n\nRepresents a single extra element. Not suitable for sending across the wire.\n\nPublic methods\n--------------\n\n### writeToParcel\n\n```\nfun writeToParcel(\n dest: Parcel, \n flags: Int\n): Unit\n```\n\nProperties\n----------\n\n### booleanExtra\n\n```\nval booleanExtra: Boolean?\n```\n\nThe boolean extra value. This should be non-null if and only if [type](#type:kotlin.Int) is\n[ExtraType.TYPE_BOOLEAN](/android/reference/com/google/android/gms/dtdi/core/ExtraType#Companion.TYPE_BOOLEAN:kotlin.Int). \n\n### byteArrayExtra\n\n```\nval byteArrayExtra: ByteArray?\n```\n\nThe byte array extra value. This should be non-null if and only if [type](#type:kotlin.Int) is\n[ExtraType.TYPE_BYTE_ARRAY](/android/reference/com/google/android/gms/dtdi/core/ExtraType#Companion.TYPE_BYTE_ARRAY:kotlin.Int). \n\n### intExtra\n\n```\nval intExtra: Int?\n```\n\nThe int extra value. This should be non-null if and only if [type](#type:kotlin.Int) is [ExtraType.TYPE_INT](/android/reference/com/google/android/gms/dtdi/core/ExtraType#Companion.TYPE_INT:kotlin.Int). \n\n### key\n\n```\nval key: String\n```\n\nThe string key for the intent extra field. \n\n### longExtra\n\n```\nval longExtra: Long?\n```\n\nThe long extra value. This should be non-null if and only if [type](#type:kotlin.Int) is [ExtraType.TYPE_LONG](/android/reference/com/google/android/gms/dtdi/core/ExtraType#Companion.TYPE_LONG:kotlin.Int). \n\n### stringExtra\n\n```\nval stringExtra: String?\n```\n\nThe string extra value. This should be non-null if and only if [type](#type:kotlin.Int) is\n[ExtraType.TYPE_STRING](/android/reference/com/google/android/gms/dtdi/core/ExtraType#Companion.TYPE_STRING:kotlin.Int). \n\n### type\n\n```\nval type: Int\n```\n\nThe type of the extra value. \n**See Also**\n\n- `\n `[ExtraType](/android/reference/com/google/android/gms/dtdi/core/ExtraType)\n `\n `\n\nCompanion properties\n--------------------\n\n### CREATOR\n\n```\nval CREATOR: Creator\u003cExtra\u003e\n```"]]