DataClient.OnDataChangedListener
Stay organized with collections
Save and categorize content based on your preferences.
Public Methods
public abstract void onDataChanged (DataEventBuffer
dataEvents)
Notification that a set of data items have been changed or deleted. The data buffer
is released upon completion of this method. If a caller wishes to use the events
outside this callback, they should be sure to freeze
the DataEvent
objects they wish to use.
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\u003eDataClient.OnDataChangedListener\u003c/code\u003e is an interface used to receive data events on Android Wear devices.\u003c/p\u003e\n"],["\u003cp\u003eIt is used with \u003ccode\u003eDataClient.addListener()\u003c/code\u003e to register for data change notifications.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eonDataChanged()\u003c/code\u003e method is triggered when data items are changed or deleted, providing a \u003ccode\u003eDataEventBuffer\u003c/code\u003e containing information about the changes.\u003c/p\u003e\n"],["\u003cp\u003eFor persistent usage outside the callback, \u003ccode\u003eDataEvent\u003c/code\u003e objects within the buffer should be frozen.\u003c/p\u003e\n"]]],[],null,["# DataClient.OnDataChangedListener\n\npublic static interface **DataClient.OnDataChangedListener** implements [DataApi.DataListener](/android/reference/com/google/android/gms/wearable/DataApi.DataListener) \nUsed with [DataClient.addListener(DataClient.OnDataChangedListener)](/android/reference/com/google/android/gms/wearable/DataClient#addListener(com.google.android.gms.wearable.DataClient.OnDataChangedListener)) to receive data\nevents. \n\n##### See Also\n\n- [WearableListenerService](/android/reference/com/google/android/gms/wearable/WearableListenerService) \n\n### Public Method Summary\n\n|---------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract void | [onDataChanged](/android/reference/com/google/android/gms/wearable/DataClient.OnDataChangedListener#onDataChanged(com.google.android.gms.wearable.DataEventBuffer))([DataEventBuffer](/android/reference/com/google/android/gms/wearable/DataEventBuffer) dataEvents) Notification that a set of data items have been changed or deleted. |\n\n### Inherited Method Summary\n\nFrom interface [com.google.android.gms.wearable.DataApi.DataListener](/android/reference/com/google/android/gms/wearable/DataApi.DataListener) \n\n|---------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract void | [onDataChanged](/android/reference/com/google/android/gms/wearable/DataApi.DataListener#onDataChanged(com.google.android.gms.wearable.DataEventBuffer))([DataEventBuffer](/android/reference/com/google/android/gms/wearable/DataEventBuffer) dataEvents) Notification that a set of data items have been changed or deleted. |\n\nPublic Methods\n--------------\n\n#### public abstract void **onDataChanged** ([DataEventBuffer](/android/reference/com/google/android/gms/wearable/DataEventBuffer) dataEvents)\n\nNotification that a set of data items have been changed or deleted. The data buffer\nis released upon completion of this method. If a caller wishes to use the events\noutside this callback, they should be sure to [freeze](/android/reference/com/google/android/gms/common/data/Freezable#freeze())\nthe [DataEvent](/android/reference/com/google/android/gms/wearable/DataEvent)\nobjects they wish to use."]]