DataEvent
Stay organized with collections
Save and categorize content based on your preferences.
Data interface for data events.
Public Method Summary
abstract DataItem
|
getDataItem()
Returns the data item modified in this event.
|
abstract int |
getType()
Returns the type of event this is.
|
Inherited Method Summary
From interface
com.google.android.gms.common.data.Freezable
abstract DataEvent
|
freeze()
|
abstract boolean |
isDataValid()
|
Constants
public static final int
TYPE_CHANGED
Indicates that the enclosing DataEvent
was triggered by a data item being added or changed.
Constant Value: 1
public static final int
TYPE_DELETED
Indicates that the enclosing DataEvent
was triggered by a data item being deleted.
Constant Value: 2
Public Methods
public abstract DataItem
getDataItem ()
Returns the data item modified in this event. An event of TYPE_DELETED
will only have its URI
populated.
public abstract int getType ()
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-11-21 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-11-21 UTC."],[[["\u003cp\u003e\u003ccode\u003eDataEvent\u003c/code\u003e is an interface providing data for events triggered by changes to data items.\u003c/p\u003e\n"],["\u003cp\u003eIt has two event types: \u003ccode\u003eTYPE_CHANGED\u003c/code\u003e for additions or modifications, and \u003ccode\u003eTYPE_DELETED\u003c/code\u003e for deletions of data items.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eDataEvent\u003c/code\u003e allows you to access the modified or deleted \u003ccode\u003eDataItem\u003c/code\u003e and determine the type of event that occurred.\u003c/p\u003e\n"],["\u003cp\u003eIt inherits methods from \u003ccode\u003eFreezable\u003c/code\u003e for data management.\u003c/p\u003e\n"]]],["`DataEvent` is an interface for data events, triggered by data item changes. Key actions include retrieving the modified data item via `getDataItem()` and determining the event type with `getType()`. Event types are `TYPE_CHANGED` (data added or modified) and `TYPE_DELETED` (data removed). `getDataItem` returns a `DataItem`; for deletions, only the URI is provided. Inherited methods allow freezing the `DataEvent` and checking if its data is valid.\n"],null,[]]