DataMapItem
Stay organized with collections
Save and categorize content based on your preferences.
Creates a new dataItem-like object containing structured and serializable data.
Inherited Method Summary
From class java.lang.Object
Public Methods
public static DataMapItem
fromDataItem
( DataItem
dataItem)
Parameters
dataItem
the base for the wrapped DataMapItem
. dataItem
should not be modified after wrapping it.
public Uri
getUri
()
Returns the underlying dataItem's Uri.
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\u003eDataMapItem\u003c/code\u003e objects store structured, serializable data and are created by wrapping a \u003ccode\u003eDataItem\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eYou can access the underlying \u003ccode\u003eDataMap\u003c/code\u003e and \u003ccode\u003eUri\u003c/code\u003e of a \u003ccode\u003eDataMapItem\u003c/code\u003e using the \u003ccode\u003egetDataMap()\u003c/code\u003e and \u003ccode\u003egetUri()\u003c/code\u003e methods, respectively.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003efromDataItem()\u003c/code\u003e method provides a \u003ccode\u003eDataMapItem\u003c/code\u003e instance from a given \u003ccode\u003eDataItem\u003c/code\u003e, freezing the \u003ccode\u003eDataItem\u003c/code\u003e in the process.\u003c/p\u003e\n"]]],["`DataMapItem` creates structured, serializable data objects. Key actions include: `fromDataItem`, which wraps a `DataItem` into a `DataMapItem` and freezes it, preventing later modifications. `getDataMap` retrieves the associated `DataMap`. `getUri` accesses the underlying `DataItem`'s `Uri`. `DataMapItem` inherits methods like `equals`, `hashCode`, `toString`, `wait`, and `notify` from `java.lang.Object`.\n"],null,["# DataMapItem\n\npublic class **DataMapItem** extends [Object](//developer.android.com/reference/java/lang/Object.html) \nCreates a new dataItem-like object containing structured and serializable data. \n\n### Public Method Summary\n\n|--------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| static [DataMapItem](/android/reference/com/google/android/gms/wearable/DataMapItem) | [fromDataItem](/android/reference/com/google/android/gms/wearable/DataMapItem#fromDataItem(com.google.android.gms.wearable.DataItem))([DataItem](/android/reference/com/google/android/gms/wearable/DataItem) dataItem) Provides a [DataMapItem](/android/reference/com/google/android/gms/wearable/DataMapItem) wrapping a dataItem. |\n| [DataMap](/android/reference/com/google/android/gms/wearable/DataMap) | [getDataMap](/android/reference/com/google/android/gms/wearable/DataMapItem#getDataMap())() Returns the [DataMap](/android/reference/com/google/android/gms/wearable/DataMap). |\n| [Uri](//developer.android.com/reference/android/net/Uri.html) | [getUri](/android/reference/com/google/android/gms/wearable/DataMapItem#getUri())() Returns the underlying dataItem's Uri. |\n\n### Inherited Method Summary\n\nFrom class java.lang.Object \n\n|----------------------------------------------------------------------------|--------------------------------------------------------------------------------|\n| [Object](//developer.android.com/reference/java/lang/Object.html) | clone() |\n| boolean | equals([Object](//developer.android.com/reference/java/lang/Object.html) arg0) |\n| void | finalize() |\n| final [Class](//developer.android.com/reference/java/lang/Class.html)\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| [String](//developer.android.com/reference/java/lang/String.html) | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nPublic Methods\n--------------\n\n#### public static [DataMapItem](/android/reference/com/google/android/gms/wearable/DataMapItem)\n**fromDataItem** ([DataItem](/android/reference/com/google/android/gms/wearable/DataItem) dataItem)\n\nProvides a [DataMapItem](/android/reference/com/google/android/gms/wearable/DataMapItem)\nwrapping a dataItem.\n\nA [DataItem](/android/reference/com/google/android/gms/wearable/DataItem)\npassed to this method does not need to be frozen ([Freezable.freeze()](/android/reference/com/google/android/gms/common/data/Freezable#freeze())),\nthis method freezes the object. \n\n##### Parameters\n\n| dataItem | the base for the wrapped [DataMapItem](/android/reference/com/google/android/gms/wearable/DataMapItem). `dataItem` should not be modified after wrapping it. |\n|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|\n\n#### public [DataMap](/android/reference/com/google/android/gms/wearable/DataMap)\n**getDataMap** ()\n\nReturns the [DataMap](/android/reference/com/google/android/gms/wearable/DataMap). \n\n#### public [Uri](//developer.android.com/reference/android/net/Uri.html) **getUri** ()\n\nReturns the underlying dataItem's Uri."]]